We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 179a4d1 commit e4b2e26Copy full SHA for e4b2e26
packages/dogs/lib/src/engine.dart
@@ -28,7 +28,12 @@ class DogEngine with MetadataMixin {
28
static bool get hasValidInstance => _instance != null;
29
30
/// Returns the current statically linked [DogEngine].
31
- static DogEngine get instance => _instance!;
+ static DogEngine get instance {
32
+ if (_instance == null) {
33
+ throw DogException("No valid DogEngine instance available. Did you forget to await initialiseDogs() in your main?");
34
+ }
35
+ return _instance!;
36
37
38
/// Read-only list of [DogConverter]s.
39
final List<DogConverter> _converters = [];
0 commit comments