Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3c0e343 authored by emancebo's avatar emancebo
Browse files

Trebuchet: fix potential NPE when info is null

Previously we were guarding against a null info object, but with the
the STK rename patches we will throw an NPE if info is null

issue-id: JALEBI-636
Change-Id: I74e95f81b64361c1bb56307c0cc621f24e701648
parent 547e5894
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -332,18 +332,22 @@ public class IconCache {
            boolean usePackageIcon, int unreadNum) {
        CacheKey cacheKey = new CacheKey(componentName, user);
        CacheEntry entry = mCache.get(cacheKey);

        boolean isCustomTitle = false;
        String activity = null;
        if (info != null) {
            boolean condition = (mContext.getResources().
                    getBoolean(R.bool.config_launcher_stkAppRename))
                    && info.getComponentName().getPackageName().toString()
                            .equalsIgnoreCase(STK_PACKAGE_NAME);
        String activity = info.getComponentName().getClassName().toString();
            activity = info.getComponentName().getClassName().toString();

        boolean isCustomTitle = false;
            if (condition
                    && !TextUtils.isEmpty(((LauncherApplication) mContext)
                            .getStkAppName(activity))) {
                isCustomTitle = true;
            }
        }
        if (entry == null || unreadNum >= 0) {
            entry = new CacheEntry();