Skip to content

Commit 99bac1d

Browse files
committed
Speculative fix for null layout params.
1 parent 0d04a82 commit 99bac1d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

OneSignalSDK/onesignal/src/main/java/com/onesignal/InAppMessageView.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ public void run() {
153153
}
154154

155155
ViewGroup.LayoutParams layoutParams = webView.getLayoutParams();
156+
if (layoutParams == null) {
157+
OneSignal.onesignalLog(
158+
OneSignal.LOG_LEVEL.WARN,
159+
"WebView height update skipped because of null layoutParams, new height will be used once it is displayed.");
160+
return;
161+
}
162+
156163
layoutParams.height = pageHeight;
157164
// We only need to update the WebView size since it's parent layouts are set to
158165
// WRAP_CONTENT to always match the height of the WebView. (Expect for fullscreen)

0 commit comments

Comments
 (0)