Skip to content

Commit

Permalink
fix: prevent rare NPE in log message
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed May 10, 2021
1 parent 20b449e commit cc5ee11
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,13 @@ class NativeBridge : Observer {
}

private fun isInvalidMessage(msg: Any?): Boolean {
if (msg !is StateEvent) {
if (msg == null || msg !is StateEvent) {
return true
}
if (!installed.get() && msg !is Install) {
logger.w("Received message before INSTALL: $msg")
return true
}

logger.d(String.format("Received NDK message %s", msg))
return false
}

Expand Down

0 comments on commit cc5ee11

Please sign in to comment.