Fix race condition NPE caught by monkey

Bug: 4080321
Change-Id: Ia6ef0a47f87ffdc96269a95cc3bc5564d2e98440
This commit is contained in:
Andy Stadler 2011-03-10 14:56:10 -08:00
parent 19829ef7ed
commit 5f830f8608
1 changed files with 6 additions and 1 deletions

View File

@ -325,6 +325,7 @@ public class AccountCheckSettingsFragment extends Fragment {
* settings) or return to its own parent (e.g. enter new credentials).
*/
private void onErrorDialogEditButton() {
// 1. handle "edit" - notify callback that we had a problem with the test
Callbacks callbackTarget = getCallbackTarget();
if (mState == STATE_AUTODISCOVER_AUTH_DIALOG) {
// report auth error to target fragment or activity
@ -333,7 +334,11 @@ public class AccountCheckSettingsFragment extends Fragment {
// report check settings failure to target fragment or activity
callbackTarget.onCheckSettingsComplete(CHECK_SETTINGS_SERVER_ERROR);
}
getFragmentManager().popBackStack();
// 2. kill self if not already killed by callback
FragmentManager fm = getFragmentManager();
if (fm != null) {
fm.popBackStack();
}
}
/**