aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <[email protected]>2025-04-28 11:14:39 +0200
committerhjk <[email protected]>2025-04-28 10:46:48 +0000
commit80c348d00a3f9a12f599b58526806f45453df648 (patch)
tree78988b8e235545f8325e732a340460068ab1f08b
parent860e949e85942631d0d09096bda7e24c147dcd88 (diff)
TextEditor: Don't crash when trying to remove from empty bookmark list
-rw-r--r--src/plugins/texteditor/bookmarkmanager.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/texteditor/bookmarkmanager.cpp b/src/plugins/texteditor/bookmarkmanager.cpp
index 3e22d9fff77..fd9b4725526 100644
--- a/src/plugins/texteditor/bookmarkmanager.cpp
+++ b/src/plugins/texteditor/bookmarkmanager.cpp
@@ -648,6 +648,8 @@ void BookmarkManager::removeAllBookmarks()
void BookmarkManager::deleteBookmark(Bookmark *bookmark)
{
int idx = m_bookmarksList.indexOf(bookmark);
+ if (idx < 0)
+ return;
beginRemoveRows(QModelIndex(), idx, idx);
m_bookmarksMap[bookmark->filePath()].removeAll(bookmark);