Fix new asset naming to always validate filename

#2212
This commit is contained in:
Wojtek Figat
2024-02-06 17:39:43 +01:00
parent 13a3035094
commit 169024ae47

View File

@@ -799,7 +799,10 @@ namespace FlaxEditor.Windows
if (proxy == null)
throw new ArgumentNullException(nameof(proxy));
// Setup name
string name = initialName ?? proxy.NewItemName;
if (!proxy.IsFileNameValid(name) || Utilities.Utils.HasInvalidPathChar(name))
name = proxy.NewItemName;
// If the proxy can not be created in the current folder, then navigate to the content folder
if (!proxy.CanCreate(CurrentViewFolder))