diff options
Diffstat (limited to 'src/main/java/eu')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 2 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/utils/DNSHelper.java | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index f7a0e210..ab1319ef 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -365,7 +365,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa break; case Message.ENCRYPTION_AXOLOTL: AxolotlService axolotlService = conversation.getAccount().getAxolotlService(); - if (axolotlService.trustedSessionVerified(conversation)) { + if (axolotlService != null && axolotlService.trustedSessionVerified(conversation)) { mEditMessage.setHint(getString(R.string.send_omemo_x509_message)); } else { mEditMessage.setHint(getString(R.string.send_omemo_message)); diff --git a/src/main/java/eu/siacs/conversations/utils/DNSHelper.java b/src/main/java/eu/siacs/conversations/utils/DNSHelper.java index f3c4f79a..e07df627 100644 --- a/src/main/java/eu/siacs/conversations/utils/DNSHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/DNSHelper.java @@ -227,10 +227,11 @@ public class DNSHelper { } public static boolean isIp(final String server) { - return PATTERN_IPV4.matcher(server).matches() + return server != null && ( + PATTERN_IPV4.matcher(server).matches() || PATTERN_IPV6.matcher(server).matches() || PATTERN_IPV6_6HEX4DEC.matcher(server).matches() || PATTERN_IPV6_HEX4DECCOMPRESSED.matcher(server).matches() - || PATTERN_IPV6_HEXCOMPRESSED.matcher(server).matches(); + || PATTERN_IPV6_HEXCOMPRESSED.matcher(server).matches()); } } |