summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDirk Rettschlag <dirk.rettschlag@gmail.com>2014-05-13 21:38:47 +0200
committerDirk Rettschlag <dirk.rettschlag@gmail.com>2014-05-13 21:38:47 +0200
commitdda7d285c2b77770d09ad2abaf4fa09f909d4636 (patch)
tree7e5ae7c0f073ccc6c018def15627b350201e1aa4 /src
parentbd04dff20feba012f8e98bea07adf5c02102efcb (diff)
downloadandroid_packages_providers_ThemesProvider-dda7d285c2b77770d09ad2abaf4fa09f909d4636.zip
android_packages_providers_ThemesProvider-dda7d285c2b77770d09ad2abaf4fa09f909d4636.tar.gz
android_packages_providers_ThemesProvider-dda7d285c2b77770d09ad2abaf4fa09f909d4636.tar.bz2
Fix NPE if themeContext is null
When installing a new theme it sometimes happens that the ThemesProvider crashes due to a NullPointerException in hasThemeComponent(...) when executing AssetManager assetManager = themeContext.getAssets(); Don't silently catch the NameNotFoundException and return an empty map. Change-Id: I9d7bf8f79b9c38cd5da668a7fcf205406ffdd79c Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/org/cyanogenmod/themes/provider/ThemePackageHelper.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java b/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java
index 73900a4..7a6fe42 100644
--- a/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java
+++ b/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java
@@ -208,7 +208,8 @@ public class ThemePackageHelper {
try {
themeContext = context.createPackageContext(pkgName, Context.CONTEXT_IGNORE_SECURITY);
} catch (NameNotFoundException e) {
- e.printStackTrace();
+ Log.e(TAG, "Error getting themeContext during insert", e);
+ return Collections.emptyMap();
}
// Determine what components the theme implements.