From 9cceedf5c7e5b42af45ce4f1f42db4afc1ebefd2 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 19 Oct 2018 16:08:07 +0200 Subject: [PATCH] container: safe alignChildrenProps --- src/browser/js/app/widgets/common/container.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/browser/js/app/widgets/common/container.js b/src/browser/js/app/widgets/common/container.js index 59f39fb3..c356d6d8 100644 --- a/src/browser/js/app/widgets/common/container.js +++ b/src/browser/js/app/widgets/common/container.js @@ -47,13 +47,15 @@ class Container extends Widget { // ...right ? :) var tabs = this.getProp('tabs'), widgets= this.getProp('widgets'), - type = tabs && tabs.length ? 'tabs' : widgets && widgets.length ? 'widgets' : null + type = tabs && tabs.length ? 'tabs' : widgets && widgets.length ? 'widgets' : null, + data = type ? this.getProp(type) : null if (!type) return + for (let i in this.children) { - if (this.children[i]) { - this.children[i].props = this.getProp(type)[i] + if (this.children[i] && data[i]) { + this.children[i].props = data[i] this.children[i].cachedProps[type] = this.children[i].props[type] if (this.children[i].alignChildrenProps) { this.children[i].alignChildrenProps()