diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-12-22 17:24:17 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-12-22 17:24:17 +0100 |
commit | 36f1b816a8ff33363b6754fb855d0f1e1cfb0611 (patch) | |
tree | 290c17f5e849842d8e22d0b9febe0df85e426d60 /src/main | |
parent | a94663aaa4d52ba27ada76abe55d2d113304b4e0 (diff) | |
parent | e1cb72b9ef4d4bfb9d11fff68e296462405d6992 (diff) |
Merge pull request #802 from SamWhited/blockingfix
Fix NPEs in blocking code
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 4 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 3a3f0778..c41a18c6 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -31,6 +31,7 @@ import java.util.ArrayList; import java.util.List; import eu.siacs.conversations.R; +import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Blockable; import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; @@ -316,7 +317,8 @@ public class ConversationActivity extends XmppActivity } else { menuUnblock.setVisible(false); } - if (!this.getSelectedConversation().getAccount().getXmppConnection().getFeatures().blocking()) { + final Account account = this.getSelectedConversation().getAccount(); + if (account.getStatus() != Account.State.ONLINE || !account.getXmppConnection().getFeatures().blocking()) { menuBlock.setVisible(false); menuUnblock.setVisible(false); } diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index 47fe5964..0dd7a2eb 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -327,7 +327,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate if (mAccount == null) { showQrCode.setVisible(false); showBlocklist.setVisible(false); - } else if (!mAccount.getXmppConnection().getFeatures().blocking()) { + } else if (mAccount.getStatus() != Account.State.ONLINE || !mAccount.getXmppConnection().getFeatures().blocking()) { showBlocklist.setVisible(false); } return true; |