Protect against non-numeric collapsed-rows.
commit8317b6e4f546f2a25a197b002d6cd63d41534533
authorMichał Sawicz <michal.sawicz@canonical.com>
dateThu 10 Jul 2014, 20:34 (12 years ago)
parentdc31931
qml/Dash/CardGrid.qml+4−1
@@ -20,7 +20,10 @@ import "../Components"
2020DashRenderer {
2121 id: root
2222
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+ }
2427
2528 expandedHeight: grid.totalContentHeight
2629 collapsedHeight: Math.min(grid.contentHeightForRows(collapsedRows), expandedHeight)