OSDN Git Service

Fix NPE in Dreams settings.
authorJohn Spurlock <jspurlock@google.com>
Thu, 9 Aug 2012 13:03:48 +0000 (09:03 -0400)
committerJohn Spurlock <jspurlock@google.com>
Thu, 9 Aug 2012 13:03:48 +0000 (09:03 -0400)
Handle the null case to avoid crashing Settings.

Change-Id: I257b766370bd604e0af5b332241619258fb732c9

src/com/android/settings/DreamComponentPreference.java

index 2114dd1..1b70db1 100644 (file)
@@ -80,7 +80,9 @@ public class DreamComponentPreference extends Preference {
                 ServiceManager.getService("dreams"));
         try {
             cn = dm.getDreamComponent();
-        } catch (RemoteException ex) {
+        } catch (RemoteException ex) { }
+
+        if (cn == null) {
             setSummary("(unknown)");
             return;
         }