Skip to content

Commit

Permalink
fix #358,#433 [add clientState null check to avoid crash]
Browse files Browse the repository at this point in the history
  • Loading branch information
FJEagle committed May 14, 2024
1 parent 1a4724f commit 5bcc028
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ internal class AlarmPingSender(val service: MqttService) : MqttPingSender {
}

override fun start() {
schedule(clientComms!!.keepAlive)
// add clientState null check to avoid ClientState.getKeepAlive() NPE(#358,#433)
clientComms?.clientState?.let {
schedule(clientComms!!.keepAlive)
}?: Timber.e("FIXME: try to start ping schedule, but clientState null, not able to get keepAlive")
}

override fun stop() {
Expand Down

0 comments on commit 5bcc028

Please sign in to comment.