Skip to content
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

Check existence of module parent in isRegistered (fix #1850) #1851

Merged
merged 2 commits into from Nov 5, 2020

Conversation

@urbnjamesmi1
Copy link
Contributor

@urbnjamesmi1 urbnjamesmi1 commented Oct 16, 2020

This PR fixes issue #1850 .

If you call store.hasModule() with an array where none of the modules or submodules are registered in the store, an error is thrown instead of returning false:

TypeError: Cannot read property 'hasChild' of undefined
        at ModuleCollection.isRegistered (/node_modules/vuex/dist/vuex.common.js:291:17)
        at Store.hasModule (/node_modules/vuex/dist/vuex.common.js:611:24)
@urbnjamesmi1 urbnjamesmi1 force-pushed the urbnjamesmi1:bug/hasModule-undefined-parent branch from dd5f21d to 93967bc Oct 16, 2020
@kiaking
kiaking approved these changes Nov 5, 2020
Copy link
Member

@kiaking kiaking left a comment

Thanks a lot! Looking nice 👍

@kiaking kiaking merged commit 12aabe4 into vuejs:dev Nov 5, 2020
6 checks passed
6 checks passed
ci/circleci: install Your tests passed on CircleCI!
Details
ci/circleci: lint-types Your tests passed on CircleCI!
Details
ci/circleci: test-e2e Your tests passed on CircleCI!
Details
ci/circleci: test-ssr Your tests passed on CircleCI!
Details
ci/circleci: test-unit Your tests passed on CircleCI!
Details
deploy/netlify Deploy preview ready!
Details
@urbnjamesmi1 urbnjamesmi1 deleted the urbnjamesmi1:bug/hasModule-undefined-parent branch Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants