Skip to content

Commit

Permalink
Additional fix for Mantis 0002478: NullReferenceException when starti…
Browse files Browse the repository at this point in the history
…ng Configuration. Also catch IOExceptions while reading the registry. See http://forum.team-mediaportal.com/bugreports-74/configuration-exe-net-crash-86638/ for further information.
  • Loading branch information
Maschine committed Oct 21, 2010
1 parent 13f2eb0 commit 446310f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mediaportal/Configuration/Sections/GeneralDaemonTools.cs
Expand Up @@ -122,27 +122,27 @@ private string GetInstalledSoftware(string Search, bool searchLocalMachine)

if (rk != null)
{
foreach (string skName in rk.GetValueNames())
try
{
try
foreach (string skName in rk.GetValueNames())
{
if (skName.ToLower().Contains(Search.ToLower()))
{
SoftwarePath = rk.GetValue(skName).ToString().Replace("\"", "");



//Old versions of DaemonTools and VirtualCloneDrive
SoftwarePath = SoftwarePath.Substring(0, SoftwarePath.LastIndexOf(@"\")) + @"\daemon.exe";
if(System.IO.File.Exists(SoftwarePath))
if (System.IO.File.Exists(SoftwarePath))
break;
//New versions of DaemonTools
SoftwarePath = SoftwarePath.Substring(0, SoftwarePath.LastIndexOf(@"\")) + @"\DTLite.exe";
break;
}

rk.Close();
}
catch (Exception) { }
}
rk.Close();
catch (Exception) { }
}
return SoftwarePath;
}
Expand Down

0 comments on commit 446310f

Please sign in to comment.