aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui/ManageAccountActivity.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-03-03 16:39:19 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-03-03 16:39:19 +0100
commit69af009c88c4ffa0ea3275c4b875a13e0ecdcddc (patch)
tree962db20530e3485340915d761cd00f291a1120cc /src/eu/siacs/conversations/ui/ManageAccountActivity.java
parentc609eefefac5097c7c40a9f1b8741e9634da316f (diff)
avoid some null pointers when pgp api is not installed
Diffstat (limited to 'src/eu/siacs/conversations/ui/ManageAccountActivity.java')
-rw-r--r--src/eu/siacs/conversations/ui/ManageAccountActivity.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/eu/siacs/conversations/ui/ManageAccountActivity.java b/src/eu/siacs/conversations/ui/ManageAccountActivity.java
index 22b82e77..5d9c4059 100644
--- a/src/eu/siacs/conversations/ui/ManageAccountActivity.java
+++ b/src/eu/siacs/conversations/ui/ManageAccountActivity.java
@@ -237,14 +237,16 @@ public class ManageAccountActivity extends XmppActivity implements ActionMode.Ca
builder.setNegativeButton("Cancel",null);
builder.create().show();
} else if (item.getItemId()==R.id.announce_pgp) {
- mode.finish();
- try {
- xmppConnectionService.generatePgpAnnouncement(selectedAccountForActionMode);
- } catch (PgpEngine.UserInputRequiredException e) {
+ if (this.hasPgp()) {
+ mode.finish();
try {
- startIntentSenderForResult(e.getPendingIntent().getIntentSender(), REQUEST_ANNOUNCE_PGP, null, 0, 0, 0);
- } catch (SendIntentException e1) {
- Log.d("gultsch","sending intent failed");
+ xmppConnectionService.generatePgpAnnouncement(selectedAccountForActionMode);
+ } catch (PgpEngine.UserInputRequiredException e) {
+ try {
+ startIntentSenderForResult(e.getPendingIntent().getIntentSender(), REQUEST_ANNOUNCE_PGP, null, 0, 0, 0);
+ } catch (SendIntentException e1) {
+ Log.d("gultsch","sending intent failed");
+ }
}
}
}