aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/utils/Resolver.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/Resolver.java b/src/main/java/de/pixart/messenger/utils/Resolver.java
index 86bdc40aa..4eb42db7e 100644
--- a/src/main/java/de/pixart/messenger/utils/Resolver.java
+++ b/src/main/java/de/pixart/messenger/utils/Resolver.java
@@ -6,6 +6,8 @@ import android.util.Log;
import androidx.annotation.NonNull;
+import org.jetbrains.annotations.NotNull;
+
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.InetAddress;
@@ -65,7 +67,9 @@ public class Resolver {
final Field dnsClientField = ReliableDNSClient.class.getDeclaredField("dnsClient");
dnsClientField.setAccessible(true);
final DNSClient dnsClient = (DNSClient) dnsClientField.get(reliableDNSClient);
- dnsClient.getDataSource().setTimeout(3000);
+ if (dnsClient != null) {
+ dnsClient.getDataSource().setTimeout(3000);
+ }
final Field useHardcodedDnsServers = DNSClient.class.getDeclaredField("useHardcodedDnsServers");
useHardcodedDnsServers.setAccessible(true);
useHardcodedDnsServers.setBoolean(dnsClient, false);
@@ -382,6 +386,7 @@ public class Resolver {
return socket;
}
+ @NotNull
@Override
public String toString() {
return "Result{" +