[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 {
|
try {
|
||||||
result = executor.invokeAny(r);
|
result = executor.invokeAny(r);
|
||||||
executor.shutdown();
|
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(() -> {
|
Thread disconnector = new Thread(() -> {
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
|
@ -428,7 +432,10 @@ public class Resolver {
|
||||||
@Override
|
@Override
|
||||||
public Result call() throws Exception {
|
public Result call() throws Exception {
|
||||||
this.connect();
|
this.connect();
|
||||||
return this.socket.isConnected() ? this : null;
|
if (this.socket != null && this.socket.isConnected()) {
|
||||||
|
return this ;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContentValues toContentValues() {
|
public ContentValues toContentValues() {
|
||||||
|
|
Loading…
Reference in New Issue