Prevent crash when container has no first element

This commit is contained in:
Martchus 2020-03-18 17:49:02 +01:00
parent 67f2802e77
commit 82e8d28bdd
2 changed files with 4 additions and 2 deletions

View File

@ -14,7 +14,7 @@ set(META_GUI_OPTIONAL true)
set(META_JS_SRC_DIR renamingutility)
set(META_VERSION_MAJOR 3)
set(META_VERSION_MINOR 3)
set(META_VERSION_PATCH 5)
set(META_VERSION_PATCH 6)
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
# add project files

View File

@ -834,7 +834,9 @@ public:
template <class ContainerType> void mkElementTree(ContainerType *container)
{
mkElementNode(container->firstElement());
if (container->firstElement()) {
mkElementNode(container->firstElement());
}
for (auto &element : container->additionalElements()) {
mkElementNode<typename ContainerType::ContainerElementType, true>(element.get());
}