blob: 76c71fb7387fcfe715fef02ba3ac06a0f42bd0a5 [file] [log] [blame]
From: Boudhayan Gupta <me@BaloneyGeek.com>
Date: Tue, 22 Sep 2015 18:55:36 +0000
Subject: Fail Baloo::File::load() if the Database is not open.
X-Git-Url: http://quickgit.kde.org/?p=baloo.git&a=commitdiff&h=29fe68f2657df503926e629477a41f7d9435048f
---
Fail Baloo::File::load() if the Database is not open.
Fixes crash if selecting multiple files in Dolphin with
Baloo disabled.
BUG: 353049
REVIEW: 125352
---
--- a/src/lib/file.cpp
+++ b/src/lib/file.cpp
@@ -98,6 +98,10 @@
Database *db = globalDatabaseInstance();
db->open(Database::OpenDatabase);
+ if (!db->isOpen()) {
+ return false;
+ }
+
quint64 id = filePathToId(QFile::encodeName(d->url));
if (!id) {
return false;