Skip to content

Commit

Permalink
Replace messageView non-null assertion with safe call operator
Browse files Browse the repository at this point in the history
Prevents NullPointerException crash when auto-dismiss IAM is manually closed.
  • Loading branch information
jennantilla committed Sep 21, 2023
1 parent fea6fa1 commit ea70883
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,14 @@ internal class WebViewManager(
}
Logging.debug("In app message, showing first one with height: $newHeight")

messageView!!.setWebView(webView!!)
messageView?.setWebView(webView!!)
if (newHeight != null) {
lastPageHeight = newHeight
messageView!!.updateHeight(newHeight)
messageView?.updateHeight(newHeight)
}
messageView!!.showView(activity)
messageView!!.checkIfShouldDismiss()
messageView?.showView(activity)
// Executed in the same thread
messageView?.checkIfShouldDismiss()
}
}

Expand Down

0 comments on commit ea70883

Please sign in to comment.