on xenial help sign in
Protect against non-numeric collapsed-rows.
8317b6eMichał Sawicz
qml/Dash/CardGrid.qml+4−1
@@ -20,7 +20,10 @@ import "../Components"
20DashRenderer {
20DashRenderer {
21 id: root
21 id: root
22
22
23− readonly property int collapsedRows: cardTool && cardTool.template && cardTool.template["collapsed-rows"]
23+ readonly property int collapsedRows: {
24+ if (!cardTool || !cardTool.template || typeof cardTool.template["collapsed-rows"] != "number") return 2;
25+ return cardTool.template["collapsed-rows"];
26+ }
24
27
25 expandedHeight: grid.totalContentHeight
28 expandedHeight: grid.totalContentHeight
26 collapsedHeight: Math.min(grid.contentHeightForRows(collapsedRows), expandedHeight)
29 collapsedHeight: Math.min(grid.contentHeightForRows(collapsedRows), expandedHeight)