We have a following code in production:
if (connection == null || !connection!!.isConnected) { disconnectSignalR() connectSignalR() }
In crashlytics I'm seeing following exception:
Caused by java.lang.NullPointerException Attempt to invoke virtual method 'boolean l.a.a.b.isOpen()' on a null object reference com.smartarmenia.dotnetcoresignalrclientjava.WebSocketHubConnectionP2.isConnected (WebSocketHubConnectionP2.java:3)
It seems that isConnected method is faulty and even though connection object is initiliazed it's inner client is still null and instead of returning simple false, we get a nasty NPE.
Is there a different way to check if connection is opened?