From 8147963b2403a7921e365e7b0f2cf51ff6549a29 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Thu, 17 May 2018 15:02:52 +0200 Subject: [PATCH] SyncJournal: Explain added file-exists check --- src/common/syncjournaldb.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/syncjournaldb.cpp b/src/common/syncjournaldb.cpp index 90a620fdd..443c29285 100644 --- a/src/common/syncjournaldb.cpp +++ b/src/common/syncjournaldb.cpp @@ -273,8 +273,10 @@ bool SyncJournalDb::sqlFail(const QString &log, const SqlQuery &query) bool SyncJournalDb::checkConnect() { if (_db.isOpen()) { + // Unfortunately the sqlite isOpen check can return true even when the underlying storage + // has become unavailable - and then some operations may cause crashes. See #6049 if (!QFile::exists(_dbFile)) { - qCWarning(lcDb) << "Database open, but file file" + _dbFile + " does not exist"; + qCWarning(lcDb) << "Database open, but file " + _dbFile + " does not exist"; close(); return false; }