diff --git a/bricks/dynamicaccordion.js b/bricks/dynamicaccordion.js index 1dd65bf..90ab37c 100644 --- a/bricks/dynamicaccordion.js +++ b/bricks/dynamicaccordion.js @@ -86,7 +86,7 @@ bricks.DynamicAccordion = class extends bricks.VScrollPanel { return; } var w; - var tb; + var tb = null; var info = new bricks.AccordionInfo({}); info.data = record; item.add_widget(info); @@ -101,8 +101,10 @@ bricks.DynamicAccordion = class extends bricks.VScrollPanel { } } w = await bricks.widgetBuild(this.record_view, info, record); - w.add_widget(tb, 0); if (w){ + if (tb){ + w.add_widget(tb, 0); + } info.add_widget(w); } else { bricks.debug('bricks.widgetBuild(), tmpl=', this.record_view, 'record=', record);