OSDN Git Service

Add missing null check to AppErrors#handleAppCrashLocked
authorErik Wolsheimer <ewol@google.com>
Fri, 5 Aug 2016 16:24:07 +0000 (09:24 -0700)
committerErik Wolsheimer <ewol@google.com>
Fri, 5 Aug 2016 16:24:07 +0000 (09:24 -0700)
BUG: 30692618
Change-Id: Ibe3589e1248520067714d5a20963a17935789066

services/core/java/com/android/server/am/AppErrors.java

index 1f156df..7eff773 100644 (file)
@@ -638,7 +638,8 @@ class AppErrors {
 
             // Allow restarting for started or bound foreground services that are crashing the
             // first time. This includes wallpapers.
-            if (sr.crashCount <= 1 && (sr.isForeground || procIsBoundForeground)) {
+            if ((data != null) && (sr.crashCount <= 1)
+                    && (sr.isForeground || procIsBoundForeground)) {
                 data.isRestartableForService = true;
             }
         }