aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java2
-rw-r--r--src/main/java/eu/siacs/conversations/utils/DNSHelper.java5
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 f7a0e2109..ab1319ef8 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 f3c4f79a2..e07df627e 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());
}
}