Commit 826eb001 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Avoids error in case there's no more servers logged in but the app was caught...

Avoids error in case there's no more servers logged in but the app was caught in the middle of connection retry
parent 997ced13
...@@ -255,6 +255,10 @@ public class RocketChatWebSocketThread extends HandlerThread { ...@@ -255,6 +255,10 @@ public class RocketChatWebSocketThread extends HandlerThread {
return prepareDDPClient() return prepareDDPClient()
.flatMap(_val -> Single.fromEmitter(emitter -> { .flatMap(_val -> Single.fromEmitter(emitter -> {
ServerInfo info = connectivityManager.getServerInfoForHost(hostname); ServerInfo info = connectivityManager.getServerInfoForHost(hostname);
if (info == null) {
emitter.onSuccess(false);
return;
}
RCLog.d("DDPClient#connect"); RCLog.d("DDPClient#connect");
ddpClient.connect(info.getSession(), info.isSecure()) ddpClient.connect(info.getSession(), info.isSecure())
.onSuccessTask(task -> { .onSuccessTask(task -> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment