Skip to content

unregister scope issue #239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ccadieux opened this issue Dec 21, 2021 · 1 comment
Closed

unregister scope issue #239

ccadieux opened this issue Dec 21, 2021 · 1 comment

Comments

@ccadieux
Copy link

The following code produces this error. Null check operator used on a null value

    GetIt.I.registerLazySingleton<A>(() => A());
    GetIt.I.pushNewScope(scopeName: 'scope');
    if (GetIt.I.isRegistered<A>()) {
      GetIt.I.unregister<A>();
    }

isRegistered checks all scopes but but unregister only uses the current scope. I don't see a way to check if something is registered in the current scope to prevent this issue.

Seems related to #189

@escamoteur
Copy link
Collaborator

fixed in next version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants