diff --git a/Framework/RemoveAddins/RemoveAddins/Utils.cs b/Framework/RemoveAddins/RemoveAddins/Utils.cs index 5e3cf0d1..e3b3fe50 100644 --- a/Framework/RemoveAddins/RemoveAddins/Utils.cs +++ b/Framework/RemoveAddins/RemoveAddins/Utils.cs @@ -50,17 +50,10 @@ public static List GetAddInFolders() localKey = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.CurrentUser, RegistryView.Registry64); esriKey = localKey.OpenSubKey(regPath); } - if (esriKey == null) - { - //this is an error - throw new System.InvalidOperationException(err1); - } - foreach (var key in esriKey.GetValueNames()) - { - myAddInPathKeys.Add(key.ToString()); - } - + if (esriKey != null) + myAddInPathKeys.AddRange(esriKey.GetValueNames().Select(key => key.ToString())); + } catch (InvalidOperationException ie) { @@ -73,7 +66,7 @@ public static List GetAddInFolders() } return myAddInPathKeys; - + } } }