From b1684439b574652166ec499b178ad317ef5b340d Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Thu, 26 Jan 2017 14:57:20 -0800 Subject: [PATCH] Add NPE check before stopping profiler During crash scenarios, stopProfiling() could be called early. Change-Id: I6ef78a47e3431dd7c41198ec29d40ebef3928c6a Fixes: 34744398 Test: N/A --- core/java/android/app/ActivityThread.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 90fab410610b3..3528daca18352 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -5032,7 +5032,9 @@ public final class ActivityThread { * @hide */ public void stopProfiling() { - mProfiler.stopProfiling(); + if (mProfiler != null) { + mProfiler.stopProfiling(); + } } static final void handleDumpHeap(boolean managed, DumpHeapData dhd) {