Skip to content

Commit

Permalink
Swap folder nullness assert for return
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Jul 18, 2023
1 parent c1b2e07 commit d6125ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/filedetails/filedetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit d6125ca

Please sign in to comment.