Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions MCPForUnity/Editor/Helpers/AssetPathUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

/// <summary>
Expand Down