Skip to content

Commit 5029365

Browse files
committed
Fix UninitializedProperty exception
If the socket was not connected, disconnect call raise the exception. Need if statement
1 parent 23c7df5 commit 5029365

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/java/moe/codeest/rxsocketclientdemo/JavaActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ public void onClick(View v) {
133133

134134
case R.id.btn_disconnect:
135135
//disconnect
136-
mClient.disconnect();
136+
if (mClient.isConnecting()) {
137+
mClient.disconnect();
138+
}
137139

138140
//or disconnect
139141
// ref.dispose();

0 commit comments

Comments
 (0)