summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremancebo <emancebo@cyngn.com>2015-09-06 14:23:34 -0700
committeremancebo <emancebo@cyngn.com>2015-09-06 14:37:08 -0700
commitf3c0e343f0f7c5ce32390e8402519456b32978b2 (patch)
treeef34ea161f7e78fc85fcdef5f48a5c4d6998f00e
parent547e58943c941931561f44b9c2627fa13906e15d (diff)
downloadandroid_packages_apps_Trebuchet-f3c0e343f0f7c5ce32390e8402519456b32978b2.tar.gz
android_packages_apps_Trebuchet-f3c0e343f0f7c5ce32390e8402519456b32978b2.tar.bz2
android_packages_apps_Trebuchet-f3c0e343f0f7c5ce32390e8402519456b32978b2.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 Change-Id: I74e95f81b64361c1bb56307c0cc621f24e701648
-rw-r--r--src/com/android/launcher3/IconCache.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index de53b9718..365f8ed2a 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -332,17 +332,21 @@ public class IconCache {
boolean usePackageIcon, int unreadNum) {
CacheKey cacheKey = new CacheKey(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);
- String activity = info.getComponentName().getClassName().toString();
boolean isCustomTitle = false;
- if (condition
- && !TextUtils.isEmpty(((LauncherApplication) mContext)
- .getStkAppName(activity))) {
- isCustomTitle = true;
+ String activity = null;
+ if (info != null) {
+ boolean condition = (mContext.getResources().
+ getBoolean(R.bool.config_launcher_stkAppRename))
+ && info.getComponentName().getPackageName().toString()
+ .equalsIgnoreCase(STK_PACKAGE_NAME);
+ activity = info.getComponentName().getClassName().toString();
+
+ if (condition
+ && !TextUtils.isEmpty(((LauncherApplication) mContext)
+ .getStkAppName(activity))) {
+ isCustomTitle = true;
+ }
}
if (entry == null || unreadNum >= 0) {
entry = new CacheEntry();