Skip to content

com.smartarmenia.dotnetcoresignalrclientjava.WebSocketHubConnectionP2.isConnected #25

@smworks

Description

@smworks

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions