From 5b3e7f0bf89144403bd14ca230bd720232b3894f Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 12 Jan 2024 13:44:01 +0100 Subject: [PATCH] Fix `FileSystem::CopyDirectory` not failing when source folder is missing --- Source/Engine/Platform/Base/FileSystemBase.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Source/Engine/Platform/Base/FileSystemBase.cpp b/Source/Engine/Platform/Base/FileSystemBase.cpp index 3d0c053d5..d4179e544 100644 --- a/Source/Engine/Platform/Base/FileSystemBase.cpp +++ b/Source/Engine/Platform/Base/FileSystemBase.cpp @@ -240,12 +240,7 @@ bool FileSystemBase::CopyFile(const String& dst, const String& src) bool FileSystemBase::CopyDirectory(const String& dst, const String& src, bool withSubDirectories) { - // Check if source exists - if (!FileSystem::DirectoryExists(*src)) - return false; - - // Copy - return FileSystemBase::DirectoryCopyHelper(dst, src, withSubDirectories); + return !FileSystem::DirectoryExists(*src) || FileSystemBase::DirectoryCopyHelper(dst, src, withSubDirectories); } uint64 FileSystemBase::GetDirectorySize(const StringView& path)