adds guards to some properties when they are undefined

This commit is contained in:
kevmodrome 2020-08-25 11:25:56 +02:00
parent 5dd80d0912
commit 22679fdf67
No known key found for this signature in database
GPG Key ID: E8F9CD141E63BF38
1 changed files with 2 additions and 2 deletions

View File

@ -115,7 +115,7 @@ const walk = ({ instance, targetId, components, models, result }) => {
// found it // found it
result.target = instance result.target = instance
} else { } else {
if (component.bindable) { if (component && component.bindable) {
// pushing all components in here initially // pushing all components in here initially
// but this will not be correct, as some of // but this will not be correct, as some of
// these components will be in another context // these components will be in another context
@ -129,7 +129,7 @@ const walk = ({ instance, targetId, components, models, result }) => {
} }
// a component that provides context to it's children // a component that provides context to it's children
const contextualInstance = component.context && instance[component.context] const contextualInstance = component && component.context && instance[component.context]
if (contextualInstance) { if (contextualInstance) {
// add to currentContexts (ancestory of context) // add to currentContexts (ancestory of context)