diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsWriter.cpp b/Gems/AudioSystem/Code/Source/Editor/AudioControlsWriter.cpp index 973da60c90..91f9aa5138 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsWriter.cpp +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsWriter.cpp @@ -84,10 +84,10 @@ namespace AudioControls m_foundLibraryPaths.begin(), m_foundLibraryPaths.end(), [fileIO](AZStd::string& libraryPath) -> void { - AZStd::optional newLength = fileIO->ConvertToAlias(libraryPath.data(), libraryPath.size()); - if (newLength) + if (auto newPathOpt = fileIO->ConvertToAlias(AZ::IO::PathView{ libraryPath }); + newPathOpt.has_value()) { - libraryPath.resize_no_construct(*newLength); + libraryPath = newPathOpt.value().Native(); } AZStd::to_lower(libraryPath.begin(), libraryPath.end()); });