From 7fcf2d52b1cafc63d41eb14114c71278af17dc80 Mon Sep 17 00:00:00 2001 From: Jezer Crespo Date: Tue, 13 May 2025 23:34:40 +0800 Subject: [PATCH] return IsEnabledMessage(false) when activity is null instead of throwing exception --- .../main/kotlin/dev/fluttercommunity/plus/wakelock/Wakelock.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wakelock_plus/android/src/main/kotlin/dev/fluttercommunity/plus/wakelock/Wakelock.kt b/wakelock_plus/android/src/main/kotlin/dev/fluttercommunity/plus/wakelock/Wakelock.kt index 8ba445a..bdc360d 100644 --- a/wakelock_plus/android/src/main/kotlin/dev/fluttercommunity/plus/wakelock/Wakelock.kt +++ b/wakelock_plus/android/src/main/kotlin/dev/fluttercommunity/plus/wakelock/Wakelock.kt @@ -29,7 +29,7 @@ internal class Wakelock { fun isEnabled(): IsEnabledMessage { if (activity == null) { - throw NoActivityException() + return IsEnabledMessage(enabled = false) } return IsEnabledMessage(enabled = enabled)