Merge "Null-pointer check when updating name of ZenRule." into oc-mr1-dev am: 268c6c6ca6
am: 7ba9e9f849
Change-Id: If4c8fa69fcc6b7be28a41ef8d51ffa463af19741
diff --git a/src/com/android/settings/notification/ZenModeRuleSettingsBase.java b/src/com/android/settings/notification/ZenModeRuleSettingsBase.java
index 5629b17..4abdd7e 100644
--- a/src/com/android/settings/notification/ZenModeRuleSettingsBase.java
+++ b/src/com/android/settings/notification/ZenModeRuleSettingsBase.java
@@ -16,6 +16,7 @@
package com.android.settings.notification;
+import android.app.Activity;
import android.app.AlertDialog;
import android.app.AutomaticZenRule;
import android.app.NotificationManager;
@@ -262,8 +263,14 @@
}
private void updateRuleName() {
- getActivity().setTitle(mRule.getName());
- mRuleName.setSummary(mRule.getName());
+ Activity activity = getActivity();
+ if (activity != null) {
+ activity.setTitle(mRule.getName());
+ mRuleName.setSummary(mRule.getName());
+ } else {
+ if (DEBUG) Log.d(TAG, "updateRuleName - activity title and mRuleName "
+ + "not updated; getActivity() returned null");
+ }
}
private AutomaticZenRule getZenRule() {