]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Swap folder nullness assert for return
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 18 Jul 2023 08:40:33 +0000 (16:40 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 18 Jul 2023 13:49:17 +0000 (15:49 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/filedetails/filedetails.cpp

index 58c1854ea8c0ceed7467bc87de3c50cc020d7fc2..67ebb554cec29e2a23075794d1324f223ec9c0c8 100644 (file)
@@ -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)) {