From 20c81be07400dfeae7b78215069c8e1d4f067f73 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 25 Jul 2016 16:42:35 +0200 Subject: [PATCH] Make sure to catch any exceptions from processing invalid/garbage paths --- renderdocui/Code/Helpers.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/renderdocui/Code/Helpers.cs b/renderdocui/Code/Helpers.cs index d7750e82f..6e4e3c316 100644 --- a/renderdocui/Code/Helpers.cs +++ b/renderdocui/Code/Helpers.cs @@ -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; }