From f219748f5dec01e0bfe9a61bd8de9e6e41bf2afa Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Mon, 6 Jun 2022 21:27:46 +0200 Subject: [PATCH] Fix missing index validity check for cursortheme BUG: 454829 (cherry picked from commit bb678094388c1eec246645ad0b07b8868aa53008) --- kcms/cursortheme/kcmcursortheme.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kcms/cursortheme/kcmcursortheme.cpp b/kcms/cursortheme/kcmcursortheme.cpp index 69f511b9c..6f7f4c170 100644 --- a/kcms/cursortheme/kcmcursortheme.cpp +++ b/kcms/cursortheme/kcmcursortheme.cpp @@ -286,7 +286,7 @@ int CursorThemeConfig::cursorThemeIndex(const QString &cursorTheme) const QString CursorThemeConfig::cursorThemeFromIndex(int index) const { QModelIndex idx = m_themeProxyModel->index(index, 0); - return m_themeProxyModel->theme(idx)->name(); + return idx.isValid() ? m_themeProxyModel->theme(idx)->name() : QString(); } void CursorThemeConfig::save()