From 6fedc6b7373f4a8d2232ad7a9b609c625d3847cd Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Mon, 6 May 2013 19:27:09 -0700 Subject: [PATCH] Fix for double-click NPE? --- .../thoughtcrime/securesms/PassphrasePromptActivity.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java b/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java index 1470e88c64..c7d6f50705 100644 --- a/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java +++ b/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java @@ -37,7 +37,6 @@ import org.thoughtcrime.securesms.util.MemoryCleaner; public class PassphrasePromptActivity extends PassphraseActivity { private EditText passphraseText; - private Button okButton; @Override public void onCreate(Bundle savedInstanceState) { @@ -48,8 +47,8 @@ public class PassphrasePromptActivity extends PassphraseActivity { } private void initializeResources() { - passphraseText = (EditText)findViewById(R.id.passphrase_edit); - okButton = (Button)findViewById(R.id.ok_button); + Button okButton = (Button) findViewById(R.id.ok_button); + passphraseText = (EditText)findViewById(R.id.passphrase_edit); okButton.setOnClickListener(new OkButtonClickListener()); } @@ -75,7 +74,7 @@ public class PassphrasePromptActivity extends PassphraseActivity { @Override protected void cleanup() { - this.passphraseText = null; + this.passphraseText.setText(""); System.gc(); } }