Skip to content

Commit b495c79

Browse files
ddx-510M-i-k-e-l
authored andcommitted
fix: add null check for ReactScreenMonitor (#2878)
1 parent d21106d commit b495c79

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactScreenMonitor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public void onHostPause() {
6262
}
6363

6464
private void registerWindowLayoutListener() {
65-
getWindow().getDecorView().getViewTreeObserver().addOnGlobalLayoutListener(mWindowLayoutListener);
65+
if (getWindow() != null) {
66+
getWindow().getDecorView().getViewTreeObserver().addOnGlobalLayoutListener(mWindowLayoutListener);
67+
}
6668
}
6769

6870
private void removeWindowLayoutListener() {

0 commit comments

Comments
 (0)