am 6529f2c9: Add some null-checks

* commit '6529f2c99d24f0dd801ed142ce946b46c92d5e9f':
  Add some null-checks
This commit is contained in:
Tony Mantler 2014-04-17 18:56:23 +00:00 committed by Android Git Automerger
commit 0e26184ac7
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");
}
}
}