Make sure to catch any exceptions from processing invalid/garbage paths

This commit is contained in:
baldurk
2016-07-25 16:42:35 +02:00
parent ba7c6711ff
commit 20c81be074
+13 -1
View File
@@ -271,7 +271,19 @@ namespace renderdocui.Code
foreach (var n in names)
{
if(String.Compare(Path.GetFullPath(n), myJSON, StringComparison.CurrentCultureIgnoreCase) == 0)
string fullpath;
try
{
fullpath = Path.GetFullPath(n);
}
catch (Exception)
{
// invalid path or similar
fullpath = "";
}
if(String.Compare(fullpath, myJSON, StringComparison.CurrentCultureIgnoreCase) == 0)
{
thisRegistered = true;
}