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

Commit 24904352 authored by emancebo's avatar emancebo Committed by Marcos Marado
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
Issue: FEIJAO-815
Change-Id: I74e95f81b64361c1bb56307c0cc621f24e701648
parent 6fa6ff69
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -568,16 +568,19 @@ public class IconCache {
            UserHandleCompat user, boolean usePackageIcon, boolean useLowResIcon) {
        ComponentKey cacheKey = new ComponentKey(componentName, user);
        CacheEntry entry = mCache.get(cacheKey);

        boolean isCustomTitle = false;
        if (info != null) {
            boolean condition = (mContext.getResources().
                    getBoolean(R.bool.config_launcher_stkAppRename))
                    && info.getComponentName().getPackageName().toString()
                            .equalsIgnoreCase(STK_PACKAGE_NAME);
        boolean isCustomTitle = false;
            if (condition
                    && !TextUtils.isEmpty(((LauncherApplication) mContext)
                            .getStkAppName())) {
                isCustomTitle = true;
            }
        }
        if (entry == null || (entry.isLowResIcon && !useLowResIcon)) {
            entry = new CacheEntry();
            mCache.put(cacheKey, entry);