Skip to content

Commit b38a70c

Browse files
FernandoFernando
authored andcommitted
WIP :: Fix crash with Splash activities
1 parent b39cb27 commit b38a70c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

debugMenu/src/main/java/com/tapadoo/debugmenu/DebugMenuAttacher.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import androidx.compose.ui.platform.ComposeView
88
import androidx.core.view.ViewCompat
99
import androidx.datastore.core.DataStore
1010
import androidx.datastore.preferences.core.Preferences
11+
import androidx.lifecycle.findViewTreeLifecycleOwner
1112
import com.tapadoo.debugmenu.module.DebugMenuModule
1213

1314
/**
@@ -52,6 +53,8 @@ object DebugMenuAttacher {
5253
enableShake: Boolean = false,
5354
) = runCatching {
5455
val decor = activity.window?.decorView as? ViewGroup ?: return@runCatching
56+
if(decor.findViewTreeLifecycleOwner() == null) return@runCatching
57+
5558
// Avoid duplicates
5659
val existing = decor.findViewWithTag<FrameLayout>(TAG)
5760
if (existing != null) return@runCatching

0 commit comments

Comments
 (0)