From 072e9d44bd1792e7aa1e91ff0b5e36804a463a46 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Mon, 22 Nov 2021 13:27:00 +0100 Subject: [PATCH] gracefully handle one case of invalid handles Signed-off-by: Matthieu Gallien --- src/libsync/vfs/cfapi/vfs_cfapi.cpp | 3 +++ 1 file changed, 3 insertions(+) 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 { -- 2.30.2