summaryrefslogtreecommitdiff
path: root/utils/themeeditor
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor')
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index 25351bf6a1..338f88525b 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -560,7 +560,9 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
560 else if(element->type == CONDITIONAL) 560 else if(element->type == CONDITIONAL)
561 { 561 {
562 int child = evalTag(info, true, element->children_count).toInt(); 562 int child = evalTag(info, true, element->children_count).toInt();
563 children[element->params_count + child]->render(info, viewport, true); 563 if(child < children.count())
564 children[element->params_count + child]
565 ->render(info, viewport, true);
564 } 566 }
565 else if(element->type == LINE_ALTERNATOR) 567 else if(element->type == LINE_ALTERNATOR)
566 { 568 {
@@ -1016,6 +1018,8 @@ QVariant ParseTreeNode::evalTag(const RBRenderInfo& info, bool conditional,
1016 1018
1017 if(child < branches) 1019 if(child < branches)
1018 return child; 1020 return child;
1021 else if(branches == 1)
1022 return 2;
1019 else 1023 else
1020 return branches - 1; 1024 return branches - 1;
1021 } 1025 }