really check that this is a valid answer when receiving batch upload
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Thu, 25 Nov 2021 15:49:20 +0000 (16:49 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 26 Nov 2021 14:49:25 +0000 (15:49 +0100)
we could somehow miss that the reply is missing proper fields

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/bulkpropagatorjob.cpp

index 2d5362a94f736e09c7c35db672a43fd21faae7b2..f6ab1ff3a52a0cec68429922dcf90fa62033bea9 100644 (file)
@@ -307,7 +307,7 @@ void BulkPropagatorJob::slotPutFinishedOneFile(const BulkUploadItem &singleFile,
 
     qCInfo(lcBulkPropagatorJob()) << singleFile._item->_file << "file headers" << fileReply;
 
-    if (!fileReply[QStringLiteral("error")].toBool()) {
+    if (fileReply.contains("error") && !fileReply[QStringLiteral("error")].toBool()) {
         singleFile._item->_httpErrorCode = static_cast<quint16>(200);
     } else {
         singleFile._item->_httpErrorCode = static_cast<quint16>(412);