Skip to content

Commit 913d0de

Browse files
committed
fix: windowInsets may be null (#1315)
1 parent d0562ff commit 913d0de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/kotlin/li/songe/gkd/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ class MainActivity : ComponentActivity() {
162162
val imePlayingFlow = MutableStateFlow(false)
163163

164164
private val imeVisible: Boolean
165-
get() = ViewCompat.getRootWindowInsets(window.decorView)!!
166-
.isVisible(WindowInsetsCompat.Type.ime())
165+
get() = ViewCompat.getRootWindowInsets(window.decorView)
166+
?.isVisible(WindowInsetsCompat.Type.ime()) == true // fix #1315
167167

168168
var topBarWindowInsets by mutableStateOf(WindowInsets(top = BarUtils.getStatusBarHeight()))
169169

0 commit comments

Comments
 (0)