Fixed #47: Error parsing corrupted registry hives
This commit is contained in:
parent
393e5af563
commit
3b1806c038
|
@ -105,7 +105,15 @@ namespace DSInternals.DataStore
|
||||||
{
|
{
|
||||||
using (var ccsKey = systemKey.OpenSubKey(CurrentControlSetKey))
|
using (var ccsKey = systemKey.OpenSubKey(CurrentControlSetKey))
|
||||||
{
|
{
|
||||||
return (int)ccsKey.GetValue(CurrentControlSetValue, DefaultControlSetId);
|
if(ccsKey != null)
|
||||||
|
{
|
||||||
|
return (int)ccsKey.GetValue(CurrentControlSetValue, DefaultControlSetId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// The "Select" value may be absent in SYSTEM registry hives that were copied from live systems without the corresponding transaction logs.
|
||||||
|
return DefaultControlSetId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue