Skip to content

Commit

Permalink
Merge pull request #1238 from bugsnag/PLAT-6513/fix-npe-log-message
Browse files Browse the repository at this point in the history
Prevent rare NPE in log message
  • Loading branch information
fractalwrench authored May 10, 2021
2 parents 20df8b1 + 85e9420 commit 49a03cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

### Bug fixes

* Fix bug that terminated the app when multiple ANRs occur
[#1235](https://github.com/bugsnag/bugsnag-android/pull/1235)
* Fix bug that terminated the app when multiple ANRs occur
[#1235](https://github.com/bugsnag/bugsnag-android/pull/1235)

* Prevent rare NPE in log message
[#1238](https://github.com/bugsnag/bugsnag-android/pull/1238)

* Prevent rare NPE when capturing thread traces
[#1237](https://github.com/bugsnag/bugsnag-android/pull/1237)
Expand Down
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 49a03cc

Please sign in to comment.