mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 03:02:15 -05:00
fix nullpointer in encrypttextactivity. fixes #1267
This commit is contained in:
parent
c4b774f7b8
commit
08e0357471
@ -59,22 +59,7 @@ public class EncryptTextActivity extends BaseActivity implements
|
||||
}
|
||||
}, false);
|
||||
|
||||
// Handle intent actions
|
||||
handleActions(getIntent(), savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initLayout() {
|
||||
setContentView(R.layout.encrypt_text_activity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handles all actions with this intent
|
||||
*
|
||||
* @param intent
|
||||
*/
|
||||
private void handleActions(Intent intent, Bundle savedInstanceState) {
|
||||
Intent intent = getIntent();
|
||||
String action = intent.getAction();
|
||||
Bundle extras = intent.getExtras();
|
||||
String type = intent.getType();
|
||||
@ -83,10 +68,6 @@ public class EncryptTextActivity extends BaseActivity implements
|
||||
extras = new Bundle();
|
||||
}
|
||||
|
||||
/*
|
||||
* Android's Action
|
||||
*/
|
||||
|
||||
// When sending to OpenKeychain Encrypt via share menu
|
||||
if (Intent.ACTION_SEND.equals(action) && type != null) {
|
||||
Log.logDebugBundle(extras, "extras");
|
||||
@ -127,6 +108,11 @@ public class EncryptTextActivity extends BaseActivity implements
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initLayout() {
|
||||
setContentView(R.layout.encrypt_text_activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onModeChanged(boolean symmetric) {
|
||||
// switch fragments
|
||||
@ -142,21 +128,29 @@ public class EncryptTextActivity extends BaseActivity implements
|
||||
|
||||
@Override
|
||||
public void onSignatureKeyIdChanged(long signatureKeyId) {
|
||||
mEncryptFragment.setSigningKeyId(signatureKeyId);
|
||||
if (mEncryptFragment != null) {
|
||||
mEncryptFragment.setSigningKeyId(signatureKeyId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEncryptionKeyIdsChanged(long[] encryptionKeyIds) {
|
||||
mEncryptFragment.setEncryptionKeyIds(encryptionKeyIds);
|
||||
if (mEncryptFragment != null) {
|
||||
mEncryptFragment.setEncryptionKeyIds(encryptionKeyIds);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEncryptionUserIdsChanged(String[] encryptionUserIds) {
|
||||
mEncryptFragment.setEncryptionUserIds(encryptionUserIds);
|
||||
if (mEncryptFragment != null) {
|
||||
mEncryptFragment.setEncryptionUserIds(encryptionUserIds);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPassphraseChanged(Passphrase passphrase) {
|
||||
mEncryptFragment.setSymmetricPassphrase(passphrase);
|
||||
if (mEncryptFragment != null) {
|
||||
mEncryptFragment.setSymmetricPassphrase(passphrase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user