Skip to content

Commit fa69d00

Browse files
committed
store [nfc]: Add account-exists assert in _reloadPerAccount
I believe this is effectively already done by the existing assert `_perAccountStores.containsKey`, because of the invariant that _accounts contains all the keys in _perAccountStores. But the explicitness seems helpful. (And loadPerAccount relies on the account existing.)
1 parent b421570 commit fa69d00

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/model/store.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ abstract class GlobalStore extends ChangeNotifier {
131131
}
132132

133133
Future<void> _reloadPerAccount(int accountId) async {
134+
assert(_accounts.containsKey(accountId));
134135
assert(_perAccountStores.containsKey(accountId));
135136
assert(!_perAccountStoresLoading.containsKey(accountId));
136137
final store = await loadPerAccount(accountId);

0 commit comments

Comments
 (0)