Skip to content

Commit

Permalink
fix: null crash in new product page with knowledge panels builder (#675)
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurtanuki authored Nov 22, 2021
1 parent ceaaef9 commit 76222ac
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ class KnowledgePanelsBuilder {

List<Widget> build(KnowledgePanels knowledgePanels) {
final List<Widget> rootPanelWidgets = <Widget>[];
if (knowledgePanels.panelIdToPanelMap['root'] == null) {
return rootPanelWidgets;
}
if (knowledgePanels.panelIdToPanelMap['root']!.elements == null) {
return rootPanelWidgets;
}
for (final KnowledgePanelElement panelElement
in knowledgePanels.panelIdToPanelMap['root']!.elements!) {
if (panelElement.elementType != KnowledgePanelElementType.PANEL) {
Expand Down

0 comments on commit 76222ac

Please sign in to comment.