From b8bd4a678abaadece08642a7782a61cb49e3e310 Mon Sep 17 00:00:00 2001 From: Borna Rajkovic Date: Fri, 8 Apr 2022 18:55:29 +0200 Subject: [PATCH] Cleaned up property fetching --- SchemeEditor.pro.user | 2 +- comdel/domain/comdelgenerator.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SchemeEditor.pro.user b/SchemeEditor.pro.user index beef5cc..bbef054 100644 --- a/SchemeEditor.pro.user +++ b/SchemeEditor.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/comdel/domain/comdelgenerator.cpp b/comdel/domain/comdelgenerator.cpp index 5d27811..9068270 100644 --- a/comdel/domain/comdelgenerator.cpp +++ b/comdel/domain/comdelgenerator.cpp @@ -396,11 +396,12 @@ optional ComdelGenerator::loadPin(PinNode node) } int getIntProperty(DisplayItemNode &node, std::string property) { - for(auto prop: node.values) { + for(auto& prop: node.values) { if(prop.key.value == property) { return prop.value.asInt(); } } + throw std::exception(); } std::optional ComdelGenerator::loadDisplay(DisplayNode node)