From 9ef1545d93823826e0a681715e694bfafa90a56f Mon Sep 17 00:00:00 2001 From: Larry Valkama Date: Mon, 6 Sep 2021 10:58:14 +0200 Subject: [PATCH] bugfix: indexing an empty categoriesTitles --- src/project/view/templatesmodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/project/view/templatesmodel.cpp b/src/project/view/templatesmodel.cpp index 59f8d76ddb..4bac242d05 100644 --- a/src/project/view/templatesmodel.cpp +++ b/src/project/view/templatesmodel.cpp @@ -91,6 +91,10 @@ void TemplatesModel::setCurrentCategory(int index) void TemplatesModel::updateTemplatesByCategory() { + if (categoriesTitles().isEmpty()) { + return; + } + m_visibleTemplates.clear(); m_currentTemplateIndex = 0;