Skip to content

Commit 2b78255

Browse files
authored
fix(remote_config, android): make onCancel accept nullable arguments to avoid crash on hot restart (#17569)
1 parent b2619e6 commit 2b78255

File tree

1 file changed

+2
-2
lines changed
  • packages/firebase_remote_config/firebase_remote_config/android/src/main/kotlin/io/flutter/plugins/firebase/firebaseremoteconfig

1 file changed

+2
-2
lines changed

packages/firebase_remote_config/firebase_remote_config/android/src/main/kotlin/io/flutter/plugins/firebase/firebaseremoteconfig/FirebaseRemoteConfigPlugin.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ class FirebaseRemoteConfigPlugin
206206
})
207207
}
208208

209-
override fun onCancel(arguments: Any) {
209+
override fun onCancel(arguments: Any?) {
210210
// arguments will be null on hot restart, so we will clean up listeners in didReinitializeFirebaseCore()
211-
val argumentsMap = arguments as Map<String, Any>
211+
val argumentsMap = arguments as? Map<String, Any>
212212
?: return
213213
val appName = Objects.requireNonNull(argumentsMap["appName"]) as String
214214

0 commit comments

Comments
 (0)