Add some null-checks

b/14117436
b/14120112

Change-Id: I0f56e036ec1a78887523d90ab4e6cda3a05accdf
This commit is contained in:
Tony Mantler 2014-04-17 11:50:25 -07:00
parent cdfffcf460
commit 6529f2c99d
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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");
}
}
}