[BUGFIX] happy eye: null pointer if no connection was etablished
This commit is contained in:
parent
3c42a9a80f
commit
937fc5e6da
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue