Avoid paths with invalid characters in IsRider

(cherry picked from commit 34c3966510)
This commit is contained in:
Raul Santos 2022-08-08 01:41:30 +02:00 committed by Rémi Verschelde
parent 9d1a972b49
commit 8f426262c8

View file

@ -66,6 +66,9 @@ namespace GodotTools.Ides.Rider
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
return false; return false;
if (path.IndexOfAny(System.IO.Path.GetInvalidPathChars()) != -1)
return false;
var fileInfo = new FileInfo(path); var fileInfo = new FileInfo(path);
string filename = fileInfo.Name.ToLowerInvariant(); string filename = fileInfo.Name.ToLowerInvariant();
return filename.StartsWith("rider", StringComparison.Ordinal); return filename.StartsWith("rider", StringComparison.Ordinal);