[Replicant] [PATCH 2/4] Revert "Trebuchet: fix potential NPE when info is null"

belgin belginstirbu at hotmail.com
Mon Nov 23 23:46:39 UTC 2020


This reverts commit 24904352007174ab1555fd201982482c797cfb9f.
---
 src/com/android/launcher3/IconCache.java | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index 59239be90..cecfb6dd3 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -568,18 +568,15 @@ public class IconCache {
             UserHandleCompat user, boolean usePackageIcon, boolean useLowResIcon) {
         ComponentKey cacheKey = new ComponentKey(componentName, user);
         CacheEntry entry = mCache.get(cacheKey);
-
+        boolean condition = (mContext.getResources().
+                getBoolean(R.bool.config_launcher_stkAppRename))
+                && info.getComponentName().getPackageName().toString()
+                        .equalsIgnoreCase(STK_PACKAGE_NAME);
         boolean isCustomTitle = false;
-        if (info != null) {
-            boolean condition = (mContext.getResources().
-                    getBoolean(R.bool.config_launcher_stkAppRename))
-                    && info.getComponentName().getPackageName().toString()
-                            .equalsIgnoreCase(STK_PACKAGE_NAME);
-            if (condition
-                    && !TextUtils.isEmpty(((LauncherApplication) mContext)
-                            .getStkAppName())) {
-                isCustomTitle = true;
-            }
+        if (condition
+                && !TextUtils.isEmpty(((LauncherApplication) mContext)
+                        .getStkAppName())) {
+            isCustomTitle = true;
         }
         if (entry == null || (entry.isLowResIcon && !useLowResIcon)) {
             entry = new CacheEntry();
-- 
2.11.0



More information about the Replicant mailing list