From eafa031c0b401d1ebac0ffbd2ab517f2a273e360 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 7 Jul 2024 19:57:43 +0200 Subject: [PATCH] Prevent NPE --- app/src/main/java/eu/faircode/email/DnsHelper.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/DnsHelper.java b/app/src/main/java/eu/faircode/email/DnsHelper.java index a16c3f0985..9ef72f6426 100644 --- a/app/src/main/java/eu/faircode/email/DnsHelper.java +++ b/app/src/main/java/eu/faircode/email/DnsHelper.java @@ -698,6 +698,8 @@ public class DnsHelper { @Override public DnsQueryResult query(DnsMessage message, InetAddress address, int port) throws IOException { DnsQueryResult result = delegate.query(message, address, port); + if (result == null) + throw new UnknownHostException(); DnsMessage answer = new DnsMessage(result.response.toArray()) .asBuilder() .setRecursionAvailable(true)