[BUGFIX] happy eye: null pointer if no connection was etablished

This commit is contained in:
genofire 2020-02-08 08:54:19 +01:00
parent 3c42a9a80f
commit 937fc5e6da
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
1 changed files with 8 additions and 1 deletions

View File

@ -274,6 +274,10 @@ public class Resolver {
try {
result = executor.invokeAny(r);
executor.shutdown();
if (result == null) {
Log.i(Config.LOGTAG, Resolver.class.getSimpleName() + ": happy eyeball unable to connect to one address");
return null;
}
Thread disconnector = new Thread(() -> {
while (true) {
try {
@ -428,7 +432,10 @@ public class Resolver {
@Override
public Result call() throws Exception {
this.connect();
return this.socket.isConnected() ? this : null;
if (this.socket != null && this.socket.isConnected()) {
return this ;
}
return null;
}
public ContentValues toContentValues() {