From 29c58cad4ef8a14ec0a723318a92da85c8325c88 Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Tue, 14 Oct 2014 16:17:06 -0700 Subject: Add null check Unable to examine bugreports that die in the middle of dump(). Help for bug 17721767. Change-Id: I31a5e03acf67c926a1cbfefe2a7ea7fca3b71b06 --- .../java/com/android/server/am/ActivityRecord.java | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'services') diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java index 198273e..1a0e45e 100755 --- a/services/core/java/com/android/server/am/ActivityRecord.java +++ b/services/core/java/com/android/server/am/ActivityRecord.java @@ -205,17 +205,20 @@ final class ActivityRecord { pw.print(" resultWho="); pw.print(resultWho); pw.print(" resultCode="); pw.println(requestCode); } - final String iconFilename = taskDescription.getIconFilename(); - if (iconFilename != null || taskDescription.getLabel() != null || - taskDescription.getPrimaryColor() != 0) { - pw.print(prefix); pw.print("taskDescription:"); - pw.print(" iconFilename="); pw.print(taskDescription.getIconFilename()); - pw.print(" label=\""); pw.print(taskDescription.getLabel()); pw.print("\""); - pw.print(" color="); - pw.println(Integer.toHexString(taskDescription.getPrimaryColor())); - } - if (iconFilename == null && taskDescription.getIcon() != null) { - pw.print(prefix); pw.println("taskDescription contains Bitmap"); + if (taskDescription != null) { + final String iconFilename = taskDescription.getIconFilename(); + if (iconFilename != null || taskDescription.getLabel() != null || + taskDescription.getPrimaryColor() != 0) { + pw.print(prefix); pw.print("taskDescription:"); + pw.print(" iconFilename="); pw.print(taskDescription.getIconFilename()); + pw.print(" label=\""); pw.print(taskDescription.getLabel()); + pw.print("\""); + pw.print(" color="); + pw.println(Integer.toHexString(taskDescription.getPrimaryColor())); + } + if (iconFilename == null && taskDescription.getIcon() != null) { + pw.print(prefix); pw.println("taskDescription contains Bitmap"); + } } if (results != null) { pw.print(prefix); pw.print("results="); pw.println(results); -- cgit v1.1