b simulators

got std::out_of_range on substr exception with 10 as size and this is the only place i use substr with size 10
This commit is contained in:
2024-08-28 21:10:43 +02:00
parent b221f8e448
commit 77feda0c0f
+7
View File
@@ -119,6 +119,8 @@ json Simulators::changed_UI_items()
// Then push the ui_item at that index to the changed json // Then push the ui_item at that index to the changed json
std::unordered_set<size_t> addedIndices; std::unordered_set<size_t> addedIndices;
try
{
for (auto& item : diff) for (auto& item : diff)
{ {
std::string path = item["path"]; std::string path = item["path"];
@@ -129,6 +131,11 @@ json Simulators::changed_UI_items()
changed["event"]["UI_items"].push_back(after["UI_items"][index]); changed["event"]["UI_items"].push_back(after["UI_items"][index]);
addedIndices.insert(index); addedIndices.insert(index);
} }
}
catch(const std::exception& e)
{
spdlog::error(e.what());
}
m_before = after; m_before = after;
return changed; return changed;