SyncJournal: Explain added file-exists check

This commit is contained in:
Christian Kamm 2018-05-17 15:02:52 +02:00 committed by Roeland Jago Douma
parent cc04ce9fe4
commit 8147963b24
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -273,8 +273,10 @@ bool SyncJournalDb::sqlFail(const QString &log, const SqlQuery &query)
bool SyncJournalDb::checkConnect() bool SyncJournalDb::checkConnect()
{ {
if (_db.isOpen()) { 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)) { 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(); close();
return false; return false;
} }