Skip to content

Commit

Permalink
Don't loose track of box objects if init crashes (#846)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-Salmon authored Nov 30, 2021
1 parent 7d5f81c commit 0721086
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hive/lib/src/hive_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ class HiveImpl extends TypeRegistryImpl implements HiveInterface {
newBox = BoxImpl<E>(this, name, comparator, compaction, backend);
}

await newBox.initialize();
_boxes[name] = newBox;
await newBox.initialize();

completer.complete();
return newBox;
Expand Down

0 comments on commit 0721086

Please sign in to comment.