Skip to content

Commit

Permalink
Fix reaching unreachable code
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Nov 8, 2023
1 parent 09a87a9 commit c10fe65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/common/checksums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ void Folder::slotWatchedPathsChanged(const QSet<QString> &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<qint64>(1_mb)) {
if (!record.isVirtualFile() && record._fileSize < static_cast<qint64>(1_mb) && !record._checksumHeader.isEmpty()) {
const auto header = ChecksumHeader::parseChecksumHeader(record._checksumHeader);
auto *compute = new ComputeChecksum(this);
compute->setChecksumType(header.type());
Expand Down

0 comments on commit c10fe65

Please sign in to comment.