OSDN Git Service

Fix NPE printing notification actions.
authorJulia Reynolds <juliacr@google.com>
Mon, 20 Jun 2016 14:23:44 +0000 (10:23 -0400)
committerJulia Reynolds <juliacr@google.com>
Mon, 20 Jun 2016 14:23:44 +0000 (10:23 -0400)
Change-Id: Icb52e7bc632bf7109a75a7695fb253b2183e7360
Fixes: 29017025

src/com/android/settings/notification/NotificationStation.java

index 3ae1b63..f0e7829 100644 (file)
@@ -404,14 +404,16 @@ public class NotificationStation extends SettingsPreferenceFragment {
                                     .append(bold(getString(
                                             R.string.notification_log_details_title)))
                                     .append(delim)
-                                    .append(action.title)
-                                    .append("\n    ")
-                                    .append(bold(getString(
-                                            R.string.notification_log_details_content_intent)))
-                                    .append(delim)
-                                    .append(formatPendingIntent(action.actionIntent));
+                                    .append(action.title);
+                            if (action.actionIntent != null) {
+                                sb.append("\n    ")
+                                        .append(bold(getString(
+                                                R.string.notification_log_details_content_intent)))
+                                        .append(delim)
+                                        .append(formatPendingIntent(action.actionIntent));
+                            }
                             if (action.getRemoteInputs() != null) {
-                                sb.append(' ')
+                                sb.append("\n    ")
                                         .append(bold(getString(
                                                 R.string.notification_log_details_remoteinput)))
                                         .append(delim)