Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-01-19 16:28:51 +0300
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>2021-08-23 10:40:26 +0300
commit7715583b14ba9d645a02f422ee2344ed142f5fad (patch)
treee7016158bc9a3a1391ff58e655ff73a1163fe316 /src/common
parent3a8706734819fdb986458063a1b18b9139edb6b7 (diff)
Correctly use indexOf
Diffstat (limited to 'src/common')
-rw-r--r--src/common/checksums.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/checksums.cpp b/src/common/checksums.cpp
index c6857e549..0c016ef4d 100644
--- a/src/common/checksums.cpp
+++ b/src/common/checksums.cpp
@@ -144,6 +144,9 @@ QByteArray makeChecksumHeader(const QByteArray &checksumType, const QByteArray &
QByteArray findBestChecksum(const QByteArray &_checksums)
{
+ if (_checksums.isEmpty()) {
+ return {};
+ }
const auto checksums = QString::fromUtf8(_checksums);
int i = 0;
// The order of the searches here defines the preference ordering.
@@ -162,7 +165,7 @@ QByteArray findBestChecksum(const QByteArray &_checksums)
return _checksums.mid(i, end - i);
}
qCWarning(lcChecksums) << "Failed to parse" << _checksums;
- return QByteArray();
+ return {};
}
bool parseChecksumHeader(const QByteArray &header, QByteArray *type, QByteArray *checksum)