diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2012-11-06 01:14:04 +0100 |
---|---|---|
committer | Jorge Ruesga <jorge@ruesga.com> | 2012-11-06 01:14:04 +0100 |
commit | 3d700489b463944efa67d35f806f9705f7e61e00 (patch) | |
tree | 318be27cdb5799107d6d159e4a2880f9eb38fcfa | |
parent | 9fe2cd7b099aaa8cf2c5eb5941af1f49797958eb (diff) | |
download | android_packages_apps_CMFileManager-3d700489b463944efa67d35f806f9705f7e61e00.tar.gz android_packages_apps_CMFileManager-3d700489b463944efa67d35f806f9705f7e61e00.tar.bz2 android_packages_apps_CMFileManager-3d700489b463944efa67d35f806f9705f7e61e00.zip |
CMFileManager: Fix NPE while retrieving background console
If the background console is null, then force allocation. Protect from NPE.
Change-Id: I57da98a9c18516f2f2936710387762dfc59543ff
-rw-r--r-- | src/com/cyanogenmod/filemanager/FileManagerApplication.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/filemanager/FileManagerApplication.java b/src/com/cyanogenmod/filemanager/FileManagerApplication.java index 1b56bb68..00859861 100644 --- a/src/com/cyanogenmod/filemanager/FileManagerApplication.java +++ b/src/com/cyanogenmod/filemanager/FileManagerApplication.java @@ -224,7 +224,10 @@ public final class FileManagerApplication extends Application { * @return Console The background console */ public static Console getBackgroundConsole() { - if (!sBackgroundConsole.getConsole().isActive()) { + if (sBackgroundConsole == null || + sBackgroundConsole.getConsole() == null || + !sBackgroundConsole.getConsole().isActive()) { + allocBackgroundConsole(getInstance().getApplicationContext()); } return sBackgroundConsole.getConsole(); |