TextEditor: Don't crash when trying to remove from empty bookmark list

Fixes: QTCREATORBUG-32774
Change-Id: I74e77822051c794f4a932cbe5c064650bcafcf3b
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2025-04-28 11:14:39 +02:00
parent 860e949e85
commit 80c348d00a

View File

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