OSDN Git Service

Fix issue #17783882: AUPT: NPE in Videos: Attempt to invoke virtual method...
authorDianne Hackborn <hackbod@google.com>
Fri, 3 Oct 2014 18:26:40 +0000 (11:26 -0700)
committerDianne Hackborn <hackbod@google.com>
Fri, 3 Oct 2014 18:43:10 +0000 (11:43 -0700)
...'java.lang.String java.lang.String.substring(int)' on a null object reference

Change-Id: I4a78653174da398a4edd23b2bc099598548b79c2

core/java/android/os/StrictMode.java

index 0ee8d86..47ea732 100644 (file)
@@ -1725,7 +1725,7 @@ public final class StrictMode {
         for (int i = 0; i < numViolations; ++i) {
             if (LOG_V) Log.d(TAG, "strict mode violation stacks read from binder call.  i=" + i);
             ViolationInfo info = new ViolationInfo(p, !currentlyGathering);
-            if (info.crashInfo.stackTrace.length() > 10000) {
+            if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 10000) {
                 // 10000 characters is way too large for this to be any sane kind of
                 // strict mode collection of stacks.  We've had a problem where we leave
                 // strict mode violations associated with the thread, and it keeps tacking