diff options
author | hjk <[email protected]> | 2025-04-28 11:14:39 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2025-04-28 10:46:48 +0000 |
commit | 80c348d00a3f9a12f599b58526806f45453df648 (patch) | |
tree | 78988b8e235545f8325e732a340460068ab1f08b | |
parent | 860e949e85942631d0d09096bda7e24c147dcd88 (diff) |
TextEditor: Don't crash when trying to remove from empty bookmark list
Fixes: QTCREATORBUG-32774
Change-Id: I74e77822051c794f4a932cbe5c064650bcafcf3b
Reviewed-by: David Schulz <[email protected]>
-rw-r--r-- | src/plugins/texteditor/bookmarkmanager.cpp | 2 |
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); |