From d6125ca3a197d5d7d60f38ef982f1e4a75b332e5 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 18 Jul 2023 16:40:33 +0800 Subject: [PATCH] Swap folder nullness assert for return Signed-off-by: Claudio Cambra --- src/gui/filedetails/filedetails.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/filedetails/filedetails.cpp b/src/gui/filedetails/filedetails.cpp index 58c1854ea8..67ebb554ce 100644 --- a/src/gui/filedetails/filedetails.cpp +++ b/src/gui/filedetails/filedetails.cpp @@ -62,7 +62,11 @@ void FileDetails::setLocalPath(const QString &localPath) connect(&_fileWatcher, &QFileSystemWatcher::fileChanged, this, &FileDetails::refreshFileDetails); const auto folder = FolderMan::instance()->folderForPath(_localPath); - Q_ASSERT(folder); + if (!folder) { + qCWarning(lcFileDetails) << "No folder found for path:" << _localPath << "will not load file details."; + return; + } + const auto file = _localPath.mid(folder->cleanPath().length() + 1); if (!folder->journalDb()->getFileRecord(file, &_fileRecord)) {