From 14088567af80ed0e2b1a2191c3132a9198c434a0 Mon Sep 17 00:00:00 2001 From: Herve_eruam Date: Thu, 2 May 2024 10:52:01 +0200 Subject: [PATCH] Assign ioError one time only. --- src/libcommonserver/utility/utility.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libcommonserver/utility/utility.cpp b/src/libcommonserver/utility/utility.cpp index 572eac7bd..9e1314d9c 100644 --- a/src/libcommonserver/utility/utility.cpp +++ b/src/libcommonserver/utility/utility.cpp @@ -780,14 +780,14 @@ bool Utility::checkIfDirEntryIsManaged(std::filesystem::recursive_directory_iter ioError = IoErrorSuccess; ItemType itemType; - if (!IoHelper::getItemType(dirIt->path(), itemType)) { - ioError = itemType.ioError; + bool result = IoHelper::getItemType(dirIt->path(), itemType); + ioError = itemType.ioError; + if (!result) { LOGW_WARN(logger(), L"Error in IoHelper::getItemType: " << Utility::formatIoError(dirIt->path(), ioError).c_str()); return false; } if (itemType.ioError == IoErrorNoSuchFileOrDirectory || itemType.ioError == IoErrorAccessDenied) { - ioError = itemType.ioError; LOGW_DEBUG(logger(), L"Error in IoHelper::getItemType: " << formatIoError(dirIt->path(), ioError).c_str()); return true; }