Skip to content

Commit 09ed4e2

Browse files
committed
fix: add a null check for WindowInsets used in isKeyboardUp()
1 parent 77d2769 commit 09ed4e2

File tree

1 file changed

+1
-1
lines changed
  • OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common

1 file changed

+1
-1
lines changed

OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/DeviceUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object DeviceUtils {
3232
isOpen =
3333
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
3434
val imeInsets = view.rootWindowInsets
35-
imeInsets.isVisible(WindowInsetsCompat.Type.ime())
35+
imeInsets?.isVisible(WindowInsetsCompat.Type.ime()) ?: false
3636
} else {
3737
// Does not work for cases when keyboard is full screen for Android 9 and below
3838
val heightDiff = metrics.heightPixels - visibleBounds.bottom

0 commit comments

Comments
 (0)