From 43ce533fa212b7a844dea64436a094da588e571e Mon Sep 17 00:00:00 2001 From: bor Date: Fri, 16 Dec 2016 15:49:42 +0330 Subject: [PATCH] added exception for IE... --- BrowserSelect/Browser.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/BrowserSelect/Browser.cs b/BrowserSelect/Browser.cs index 61da157..a96cd93 100644 --- a/BrowserSelect/Browser.cs +++ b/BrowserSelect/Browser.cs @@ -111,8 +111,13 @@ private static List find(RegistryKey hklm) // because of the try catch, but there are still things that could go wrong //0. check if it can handle the http protocol - if ((string)key.OpenSubKey("Capabilities").OpenSubKey("URLAssociations").GetValue("http") == null) - continue; + var capabilities = key.OpenSubKey("Capabilities"); + // IE does not have the capabilities subkey... + // so assume that the app can handle http if it doesn't + // advertise it's capablities + if(capabilities != null) + if ((string)capabilities.OpenSubKey("URLAssociations").GetValue("http") == null) + continue; //1. check if path is not empty if (string.IsNullOrWhiteSpace(exec)) continue;