diff --git a/lib/get_it_impl.dart b/lib/get_it_impl.dart index 9578a9a..b28373f 100644 --- a/lib/get_it_impl.dart +++ b/lib/get_it_impl.dart @@ -142,8 +142,8 @@ class _ServiceFactory { if (instance is Disposable) { return (instance! as Disposable).onDispose(); } + //if a LazySingletons was never accessed instance is null if (instance != null) { - // this can happen with LazySingletons that were never be used return disposeFunction?.call(instance!); } }