From 6529f2c99d24f0dd801ed142ce946b46c92d5e9f Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Thu, 17 Apr 2014 11:50:25 -0700 Subject: [PATCH] Add some null-checks b/14117436 b/14120112 Change-Id: I0f56e036ec1a78887523d90ab4e6cda3a05accdf --- .../setup/CheckSettingsProgressDialogFragment.java | 7 ++++++- .../activity/setup/DuplicateAccountDialogFragment.java | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/com/android/email/activity/setup/CheckSettingsProgressDialogFragment.java b/src/com/android/email/activity/setup/CheckSettingsProgressDialogFragment.java index d52b46ca2..ea24ff10e 100644 --- a/src/com/android/email/activity/setup/CheckSettingsProgressDialogFragment.java +++ b/src/com/android/email/activity/setup/CheckSettingsProgressDialogFragment.java @@ -25,6 +25,7 @@ import android.content.DialogInterface; import android.os.Bundle; import com.android.email.R; +import com.android.mail.utils.LogUtils; /** * Simple dialog that shows progress as we work through the settings checks. @@ -110,7 +111,11 @@ public class CheckSettingsProgressDialogFragment extends DialogFragment { public void onCancel(DialogInterface dialog) { super.onCancel(dialog); final Callback callback = (Callback) getActivity(); - callback.onCheckSettingsProgressDialogCancel(); + if (callback != null) { + callback.onCheckSettingsProgressDialogCancel(); + } else { + LogUtils.d(LogUtils.TAG, "Null callback in CheckSettings dialog onCancel"); + } } @Override diff --git a/src/com/android/email/activity/setup/DuplicateAccountDialogFragment.java b/src/com/android/email/activity/setup/DuplicateAccountDialogFragment.java index 3c9a5bcea..902606819 100644 --- a/src/com/android/email/activity/setup/DuplicateAccountDialogFragment.java +++ b/src/com/android/email/activity/setup/DuplicateAccountDialogFragment.java @@ -17,6 +17,7 @@ package com.android.email.activity.setup; import com.android.email.R; +import com.android.mail.utils.LogUtils; import android.app.AlertDialog; import android.app.Dialog; @@ -72,6 +73,10 @@ public class DuplicateAccountDialogFragment extends DialogFragment { public void onDismiss(DialogInterface dialog) { super.onDismiss(dialog); final Callback callback = (Callback) getActivity(); - callback.onDuplicateAccountDialogDismiss(); + if (callback != null) { + callback.onDuplicateAccountDialogDismiss(); + } else { + LogUtils.d(LogUtils.TAG, "Null callback in DuplicateAccount dialog onDismiss"); + } } }