Skip to content

Commit faf4545

Browse files
store: Make realmName and realmIcon getters non-null
These values are populated in the `account` from `InitialSnapshot` during `UpdateMachine.load` but before `PerAccountStore` is created. So, these values should never be null when we have the `PerAccountStore`.
1 parent 343102d commit faf4545

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/model/store.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,15 @@ abstract class PerAccountStoreBase {
423423
/// Always equal to `account.realmUrl` and `connection.realmUrl`.
424424
Uri get realmUrl => connection.realmUrl;
425425

426-
String? get realmName => account.realmName;
427-
428-
Uri? get realmIcon => account.realmIcon;
426+
// The `account` is populated with the `realmName` before
427+
// PerAccountStore is created, so this should never be null.
428+
// See `UpdateMachine.load`.
429+
String get realmName => account.realmName!;
430+
431+
// The `account` is populated with the `realmIcon` before
432+
// PerAccountStore is created, so this should never be null.
433+
// See `UpdateMachine.load`.
434+
Uri get realmIcon => account.realmIcon!;
429435

430436
/// Resolve [reference] as a URL relative to [realmUrl].
431437
///

0 commit comments

Comments
 (0)