diff --git a/workers/unity/Assets/Plugins.meta b/workers/unity/Assets/Plugins.meta index 29fe44ed3a..56ea2be713 100644 --- a/workers/unity/Assets/Plugins.meta +++ b/workers/unity/Assets/Plugins.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5959c7a18b7b849468e98e7eae589170 +guid: 0bfcc7b81e816e04aae6ed60da22adac folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/workers/unity/Packages/com.improbable.gdk.tools/GdkToolsConfiguration.cs b/workers/unity/Packages/com.improbable.gdk.tools/GdkToolsConfiguration.cs index 91a9a79e90..494ebf57fc 100644 --- a/workers/unity/Packages/com.improbable.gdk.tools/GdkToolsConfiguration.cs +++ b/workers/unity/Packages/com.improbable.gdk.tools/GdkToolsConfiguration.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Net; using UnityEngine; @@ -55,26 +54,32 @@ internal List Validate() errors.Add($"{GdkToolsConfigurationWindow.DescriptorOutputDirLabel} cannot be empty."); } - var emptySchemaSourceDir = false; - foreach (var schemaSourceDir in SchemaSourceDirs) + for (var i = 0; i < SchemaSourceDirs.Count; i++) { + var schemaSourceDir = SchemaSourceDirs[i]; + if (!string.IsNullOrEmpty(schemaSourceDir)) { - var fullSchemaSourceDirPath = Path.Combine(UnityProjectRoot, schemaSourceDir); + string fullSchemaSourceDirPath; + try + { + fullSchemaSourceDirPath = Path.Combine(UnityProjectRoot, schemaSourceDir); + } + catch (ArgumentException) + { + errors.Add($"Schema path [{i}] contains one or more invalid characters."); + continue; + } + if (!Directory.Exists(fullSchemaSourceDirPath)) { errors.Add($"{fullSchemaSourceDirPath} cannot be found."); } - - continue; } - - emptySchemaSourceDir = true; - } - - if (emptySchemaSourceDir) - { - errors.Add($"Cannot have any empty entry in {GdkToolsConfigurationWindow.SchemaSourceDirsLabel}."); + else + { + errors.Add($"Schema path [{i}] is empty. You must provide a valid path."); + } } if (!string.IsNullOrEmpty(RuntimeIp) && !IPAddress.TryParse(RuntimeIp, out _))