diff --git a/MCPForUnity/Editor/Helpers/AssetPathUtility.cs b/MCPForUnity/Editor/Helpers/AssetPathUtility.cs index 34241dbd0..1af9ea236 100644 --- a/MCPForUnity/Editor/Helpers/AssetPathUtility.cs +++ b/MCPForUnity/Editor/Helpers/AssetPathUtility.cs @@ -448,8 +448,18 @@ public static bool IsLocalServerPath() return false; // Check for file:// protocol or absolute local path - return fromUrl.StartsWith("file://", StringComparison.OrdinalIgnoreCase) || - System.IO.Path.IsPathRooted(fromUrl); + if (fromUrl.StartsWith("file://", StringComparison.OrdinalIgnoreCase)) + return true; + + try + { + return System.IO.Path.IsPathRooted(fromUrl); + } + catch (System.ArgumentException) + { + // fromUrl contains characters illegal in paths (e.g. a remote URL) + return false; + } } ///