From b4e48f9dba3a42a524e0bdcd1e2a3a2e76c46fb8 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Tue, 7 Aug 2012 19:06:23 -0700 Subject: [PATCH] Fix for NPE which should never happen, but apparently does. --- src/org/thoughtcrime/securesms/PassphrasePromptActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java b/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java index cdd22037e2..8c90795f08 100644 --- a/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java +++ b/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java @@ -17,6 +17,7 @@ package org.thoughtcrime.securesms; import android.os.Bundle; +import android.text.Editable; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; @@ -59,7 +60,8 @@ public class PassphrasePromptActivity extends PassphraseActivity { private class OkButtonClickListener implements OnClickListener { public void onClick(View v) { try { - String passphrase = passphraseText.getText().toString(); + Editable text = passphraseText.getText(); + String passphrase = (text == null ? "" : text.toString()); MasterSecret masterSecret = MasterSecretUtil.getMasterSecret(PassphrasePromptActivity.this, passphrase); MemoryCleaner.clean(passphrase);