fix NPE in NsClientService
This commit is contained in:
parent
ff30d9af80
commit
2677f3cca7
1 changed files with 3 additions and 2 deletions
|
@ -248,7 +248,8 @@ public class NSClientService extends Service {
|
||||||
@Override
|
@Override
|
||||||
public void call(Object... args) {
|
public void call(Object... args) {
|
||||||
connectCounter++;
|
connectCounter++;
|
||||||
MainApp.bus().post(new EventNSClientNewLog("NSCLIENT", "connect #" + connectCounter + " event. ID: " + mSocket.id()));
|
String socketId = mSocket != null ? mSocket.id() : "NULL";
|
||||||
|
MainApp.bus().post(new EventNSClientNewLog("NSCLIENT", "connect #" + connectCounter + " event. ID: " + socketId));
|
||||||
sendAuthMessage(new NSAuthAck());
|
sendAuthMessage(new NSAuthAck());
|
||||||
watchdog();
|
watchdog();
|
||||||
}
|
}
|
||||||
|
@ -289,7 +290,7 @@ public class NSClientService extends Service {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public void destroy() {
|
public synchronized void destroy() {
|
||||||
if (mSocket != null) {
|
if (mSocket != null) {
|
||||||
mSocket.off(Socket.EVENT_CONNECT);
|
mSocket.off(Socket.EVENT_CONNECT);
|
||||||
mSocket.off(Socket.EVENT_DISCONNECT);
|
mSocket.off(Socket.EVENT_DISCONNECT);
|
||||||
|
|
Loading…
Reference in a new issue