forked from qt-creator/qt-creator
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:
@@ -648,6 +648,8 @@ void BookmarkManager::removeAllBookmarks()
|
|||||||
void BookmarkManager::deleteBookmark(Bookmark *bookmark)
|
void BookmarkManager::deleteBookmark(Bookmark *bookmark)
|
||||||
{
|
{
|
||||||
int idx = m_bookmarksList.indexOf(bookmark);
|
int idx = m_bookmarksList.indexOf(bookmark);
|
||||||
|
if (idx < 0)
|
||||||
|
return;
|
||||||
beginRemoveRows(QModelIndex(), idx, idx);
|
beginRemoveRows(QModelIndex(), idx, idx);
|
||||||
|
|
||||||
m_bookmarksMap[bookmark->filePath()].removeAll(bookmark);
|
m_bookmarksMap[bookmark->filePath()].removeAll(bookmark);
|
||||||
|
Reference in New Issue
Block a user