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);