Fix for another NPE which should never happen but apparently does.

This commit is contained in:
Moxie Marlinspike 2012-08-07 19:09:16 -07:00
parent b4e48f9dba
commit faa3d2276e

View File

@ -16,18 +16,19 @@
*/ */
package org.thoughtcrime.securesms; package org.thoughtcrime.securesms;
import org.thoughtcrime.securesms.crypto.InvalidPassphraseException;
import org.thoughtcrime.securesms.crypto.MasterSecret;
import org.thoughtcrime.securesms.crypto.MasterSecretUtil;
import org.thoughtcrime.securesms.util.MemoryCleaner;
import android.os.Bundle; import android.os.Bundle;
import android.text.Editable;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.Toast; import android.widget.Toast;
import org.thoughtcrime.securesms.crypto.InvalidPassphraseException;
import org.thoughtcrime.securesms.crypto.MasterSecret;
import org.thoughtcrime.securesms.crypto.MasterSecretUtil;
import org.thoughtcrime.securesms.util.MemoryCleaner;
/** /**
* Activity for changing a user's local encryption passphrase. * Activity for changing a user's local encryption passphrase.
* *
@ -63,9 +64,13 @@ public class PassphraseChangeActivity extends PassphraseActivity {
} }
private void verifyAndSavePassphrases() { private void verifyAndSavePassphrases() {
String original = this.originalPassphrase.getText().toString(); Editable originalText = this.originalPassphrase.getText();
String passphrase = this.newPassphrase.getText().toString(); Editable newText = this.newPassphrase.getText();
String passphraseRepeat = this.repeatPassphrase.getText().toString(); Editable repeatText = this.repeatPassphrase.getText();
String original = (originalText == null ? "" : originalText.toString());
String passphrase = (newText == null ? "" : newText.toString());
String passphraseRepeat = (repeatText == null ? "" : repeatText.toString());
try { try {
if (!passphrase.equals(passphraseRepeat)) { if (!passphrase.equals(passphraseRepeat)) {