Validate paramaters in onError in NS Client

This commit is contained in:
Brian Quinion 2020-02-20 16:56:56 +00:00
parent 43495e2565
commit 385781de23

View file

@ -401,7 +401,11 @@ public class NSClientService extends Service {
private Emitter.Listener onError = new Emitter.Listener() { private Emitter.Listener onError = new Emitter.Listener() {
@Override @Override
public void call(final Object... args) { public void call(final Object... args) {
RxBus.INSTANCE.send(new EventNSClientNewLog("ERROR", args[0].toString())); String msg = "Unknown Error";
if (args.length > 0 && args[0] != null) {
msg = args[0].toString();
}
RxBus.INSTANCE.send(new EventNSClientNewLog("ERROR", msg));
} }
}; };