gracefully handle one case of invalid handles

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2021-11-22 13:27:00 +01:00 committed by Matthieu Gallien (Rebase PR Action)
parent a3013de6ea
commit 072e9d44bd

View file

@ -160,6 +160,9 @@ Result<Vfs::ConvertToPlaceholderResult, QString> 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 {