diff --git a/src/common/checksums.cpp b/src/common/checksums.cpp index 82e64e7053a..76f87288678 100644 --- a/src/common/checksums.cpp +++ b/src/common/checksums.cpp @@ -227,6 +227,7 @@ ComputeChecksum::~ComputeChecksum() void ComputeChecksum::setChecksumType(CheckSums::Algorithm type) { + Q_ASSERT(type != CheckSums::Algorithm::NONE && type != CheckSums::Algorithm::PARSE_ERROR); _checksumType = type; } diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 60b8eaf3f21..61938f8596b 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -701,7 +701,7 @@ void Folder::slotWatchedPathsChanged(const QSet &paths, ChangeReason re Q_ASSERT([&] { Q_ASSERT(record.isValid()); // we don't intend to burn to many cpu cycles so limit this check on small files - if (!record.isVirtualFile() && record._fileSize < static_cast(1_mb)) { + if (!record.isVirtualFile() && record._fileSize < static_cast(1_mb) && !record._checksumHeader.isEmpty()) { const auto header = ChecksumHeader::parseChecksumHeader(record._checksumHeader); auto *compute = new ComputeChecksum(this); compute->setChecksumType(header.type());