summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremancebo <emancebo@cyngn.com>2015-09-06 14:23:34 -0700
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2016-09-13 11:15:57 -0700
commit84e0879a51797c004e6b4b2eaebe3f4ec79e4f38 (patch)
treec36e84f7a3750f23cdff111d1eabf0c2de85b9ca
parent532c8c18e111836fcf5390bb19639fdd81cfb9c7 (diff)
downloadandroid_packages_apps_Trebuchet-84e0879a51797c004e6b4b2eaebe3f4ec79e4f38.tar.gz
android_packages_apps_Trebuchet-84e0879a51797c004e6b4b2eaebe3f4ec79e4f38.tar.bz2
android_packages_apps_Trebuchet-84e0879a51797c004e6b4b2eaebe3f4ec79e4f38.zip
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
-rw-r--r--src/com/android/launcher3/IconCache.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index cecfb6dd3..59239be90 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -568,15 +568,18 @@ 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 (condition
- && !TextUtils.isEmpty(((LauncherApplication) mContext)
- .getStkAppName())) {
- isCustomTitle = true;
+ 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 (entry == null || (entry.isLowResIcon && !useLowResIcon)) {
entry = new CacheEntry();