Add null checks in CallFeaturesSettings
Bug: 17939776
Change-Id: Ib02d0c4dd88cf81d60b1cbdaa7b2869e9165bdc8
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index b85cb7e..c38df5c 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -485,7 +485,10 @@
mAudioManager.setParameter(HAC_KEY, hac != 0 ? HAC_VAL_ON : HAC_VAL_OFF);
return true;
} else if (preference == mVoicemailSettings) {
- mVoicemailSettings.getDialog().getActionBar().setDisplayHomeAsUpEnabled(false);
+ final Dialog dialog = mVoicemailSettings.getDialog();
+ if (dialog != null) {
+ dialog.getActionBar().setDisplayHomeAsUpEnabled(false);
+ }
if (DBG) log("onPreferenceTreeClick: Voicemail Settings Preference is clicked.");
if (preference.getIntent() != null) {
if (DBG) {
@@ -511,7 +514,10 @@
return false;
}
} else if (preference == mVoicemailSettingsScreen) {
- mVoicemailSettingsScreen.getDialog().getActionBar().setDisplayHomeAsUpEnabled(false);
+ final Dialog dialog = mVoicemailSettingsScreen.getDialog();
+ if (dialog != null) {
+ dialog.getActionBar().setDisplayHomeAsUpEnabled(false);
+ }
return false;
}
return false;