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

Defensive checks required around setUpItems() #2480

Closed
brian-learningpool opened this issue Jul 26, 2019 · 0 comments
Closed

Defensive checks required around setUpItems() #2480

brian-learningpool opened this issue Jul 26, 2019 · 0 comments
Assignees
Labels

Comments

@brian-learningpool
Copy link
Member

This is a bit of an edge case, but if an accordion component is added which does not contain any _items, the setUpItems function here (https://github.com/adaptlearning/adapt_framework/blob/master/src/core/js/models/itemsComponentModel.js#L24) fails and never runs for any subsequent components. As such the toJSON() call in the same code fails because _children is null and prevents the course from rendering.

@brian-learningpool brian-learningpool self-assigned this Jul 26, 2019
@brian-learningpool brian-learningpool changed the title Defensive checks required around setupItems Defensive checks required around setUpItems() Jul 26, 2019
brian-learningpool added a commit that referenced this issue Jul 31, 2019
If '_items' was not set this would throw an error which would prevent the content from loading.
brian-learningpool added a commit that referenced this issue Jul 31, 2019
If '_items' was not set this would throw an error which would prevent the content from loading.
moloko pushed a commit that referenced this issue Aug 2, 2019
* Resolves #2480, adds a guard on '_items' property

If '_items' was not set this would throw an error which would prevent the content from loading.
@moloko moloko closed this as completed in 25579f4 Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant