From: Matthieu Gallien Date: Mon, 22 Nov 2021 12:27:00 +0000 (+0100) Subject: gracefully handle one case of invalid handles X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~18^2~90^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=072e9d44bd1792e7aa1e91ff0b5e36804a463a46;p=nextcloud-desktop.git gracefully handle one case of invalid handles Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/vfs/cfapi/vfs_cfapi.cpp b/src/libsync/vfs/cfapi/vfs_cfapi.cpp index 76e3c446d..1adeb5d68 100644 --- a/src/libsync/vfs/cfapi/vfs_cfapi.cpp +++ b/src/libsync/vfs/cfapi/vfs_cfapi.cpp @@ -160,6 +160,9 @@ Result VfsCfApi::convertToPlaceholder( const auto replacesPath = QDir::toNativeSeparators(replacesFile); const auto handle = cfapi::handleForPath(localPath); + if (!handle) { + return { "Invalid handle for path " + localPath }; + } if (cfapi::findPlaceholderInfo(handle)) { return cfapi::updatePlaceholderInfo(handle, item._modtime, item._size, item._fileId, replacesPath); } else {