Skip to content

Commit

Permalink
Ignore background handler messages coming in when we are not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
kaaholst committed Nov 1, 2024
1 parent 1e78705 commit 5c676eb
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -829,11 +829,13 @@ private class CliHandler extends Handler {
@Override
public void handleMessage(android.os.Message msg) {
switch (msg.what) {
case MSG_PUBLISH: {
PublishMessage message = (PublishMessage) msg.obj;
_publishMessage(message.request, message.channel, message.responseChannel, message.publishListener);
case MSG_PUBLISH:
if (mConnectionState.isConnected()) {
PublishMessage message = (PublishMessage) msg.obj;
_publishMessage(message.request, message.channel, message.responseChannel, message.publishListener);
}
break;
}

case MSG_DISCONNECT:
removeCallbacksAndMessages(null);
cleanupBayeuxClient();
Expand Down Expand Up @@ -873,7 +875,7 @@ public void handleMessage(android.os.Message msg) {
break;
}
case MSG_REFRESH_SERVER_STATUS:
requestServerStatus();
if (mConnectionState.isConnected()) requestServerStatus();
break;
}
}
Expand Down

0 comments on commit 5c676eb

Please sign in to comment.