From 8b82452a1bcb1781a8866ec4979f3600efb5686c Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 16 Nov 2021 17:30:33 -0800 Subject: [PATCH] Updated ResolvePathReference to also early-return when the path is empty. @gadams3 said this would be helpful to him. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Gems/Atom/RPI/Code/Source/RPI.Edit/Common/AssetUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/AssetUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/AssetUtils.cpp index 73c64b8015..e2877aa163 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/AssetUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/AssetUtils.cpp @@ -47,8 +47,8 @@ namespace AZ AZStd::string ResolvePathReference(const AZStd::string& originatingSourceFilePath, const AZStd::string& referencedSourceFilePath) { - // Prevents "second join parameter is an absolute path" warnings in StringFunc::Path::Join below - if (AZ::IO::PathView{referencedSourceFilePath}.IsAbsolute()) + // The IsAbsolute part prevents "second join parameter is an absolute path" warnings in StringFunc::Path::Join below + if (referencedSourceFilePath.empty() || AZ::IO::PathView{referencedSourceFilePath}.IsAbsolute()) { return referencedSourceFilePath; }