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;
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.text.Editable;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
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.
*
@ -63,9 +64,13 @@ public class PassphraseChangeActivity extends PassphraseActivity {
}
private void verifyAndSavePassphrases() {
String original = this.originalPassphrase.getText().toString();
String passphrase = this.newPassphrase.getText().toString();
String passphraseRepeat = this.repeatPassphrase.getText().toString();
Editable originalText = this.originalPassphrase.getText();
Editable newText = this.newPassphrase.getText();
Editable repeatText = this.repeatPassphrase.getText();
String original = (originalText == null ? "" : originalText.toString());
String passphrase = (newText == null ? "" : newText.toString());
String passphraseRepeat = (repeatText == null ? "" : repeatText.toString());
try {
if (!passphrase.equals(passphraseRepeat)) {