From 4aa8374ddec47ab88cd8261036ea1382c107c4b3 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 16 Sep 2015 16:38:56 +0200 Subject: [PATCH] Bookmarks: Make sure we do not end up with empty filenames ... in the bookmarks. The actions should all be disabled if that is the case, but better safe than sorry (e.g. when a temporary document is not marked up as such). Change-Id: I131a870dc30258a8bca3fc57edb4692292ccb2de Reviewed-by: Daniel Teske --- src/plugins/bookmarks/bookmarkmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index 66aecea2917..d2fef2a0619 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -438,7 +438,7 @@ QMimeData *BookmarkManager::mimeData(const QModelIndexList &indexes) const void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber) { - if (lineNumber <= 0) + if (lineNumber <= 0 || fileName.isEmpty()) return; // Remove any existing bookmark on this line