Skip to content

Commit aece063

Browse files
committed
fix: add guard
1 parent d8bf7f0 commit aece063

File tree

1 file changed

+3
-0
lines changed
  • packages/brownie/android/src/main/java/com/callstack/brownie

1 file changed

+3
-0
lines changed

packages/brownie/android/src/main/java/com/callstack/brownie/StoreManager.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class StoreManager private constructor() {
2222
*/
2323
fun <State> register(store: Store<State>, key: String) {
2424
lock.withLock {
25+
check(!stores.containsKey(key)) {
26+
"Store with key '$key' is already registered. Remove the previous store first using Store.close() or StoreManager.removeStore(key)"
27+
}
2528
stores[key] = store
2629
}
2730
}

0 commit comments

Comments
 (0)