am 95ef5575: Prevent NPE in onActivityResult

* commit '95ef5575a2b70d8c018f99b218353c925a70d418':
  Prevent NPE in onActivityResult
This commit is contained in:
Andy Stadler
2011-02-01 17:27:26 -08:00
committed by Android Git Automerger

View File

@@ -31,6 +31,7 @@ import android.os.BatteryManager;
import android.os.Bundle; import android.os.Bundle;
import android.preference.Preference; import android.preference.Preference;
import android.preference.PreferenceActivity; import android.preference.PreferenceActivity;
import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@@ -184,9 +185,11 @@ public class CryptKeeperSettings extends Fragment {
// If the user entered a valid keyguard trace, present the final // If the user entered a valid keyguard trace, present the final
// confirmation prompt; otherwise, go back to the initial state. // confirmation prompt; otherwise, go back to the initial state.
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK && data != null) {
String password = data.getStringExtra("password"); String password = data.getStringExtra("password");
showFinalConfirmation(password); if (!TextUtils.isEmpty(password)) {
showFinalConfirmation(password);
}
} }
} }