aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian.schneppe@pix-art.de>2020-02-08 18:38:19 +0100
committerChristian Schneppe <christian.schneppe@pix-art.de>2020-02-08 18:38:19 +0100
commite96467e5ad9e001086be19cb6521c0f59ab8fd64 (patch)
tree58d211a739001824b4fc40dac201704600b4a9a6 /src/main/java/de/pixart/messenger
parent2d5a7e013a1c88616cca89ac4ac5ab2190971ef3 (diff)
catch some more NPE in Resolver.java
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-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{" +