From 284a44d74c8b064967af8c07cd47a5edb4a63ef9 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 16 Nov 2021 11:45:26 -0800 Subject: [PATCH] Updated AssetUtils::ResolvePathReference to avoid "The second join parameter is an absolute path" warnings from StringFunc::Path::Join. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Gems/Atom/RPI/Code/Source/RPI.Edit/Common/AssetUtils.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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 c940ef808b..c779453c25 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/AssetUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/AssetUtils.cpp @@ -10,6 +10,7 @@ #include #include #include +#include namespace AZ { @@ -46,6 +47,12 @@ 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()) + { + return referencedSourceFilePath; + } + AZStd::string normalizedReferencedPath = referencedSourceFilePath; AzFramework::StringFunc::Path::Normalize(normalizedReferencedPath);