Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit f4ad96b

Browse files
committed
Continue if configuration is missing
Rather than throwing an exception and outright failing, we'll just return default values when expected configuration is missing. We may make this more robust in the future.
1 parent ed5d89b commit f4ad96b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/votive/WixPackageSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ public void Refresh()
223223
{
224224
using (RegistryKey regKey = Registry.LocalMachine.OpenSubKey(this.rootPath, false))
225225
{
226-
object regValue = regKey.GetValue(this.name, this.defaultValue, RegistryValueOptions.None);
226+
object regValue = regKey?.GetValue(this.name, this.defaultValue, RegistryValueOptions.None);
227227
this.initialized = true;
228-
this.settingValue = (T) regValue;
228+
this.settingValue = regValue == null ? default(T) : (T)regValue;
229229
}
230230
}
231231

0 commit comments

Comments
 (0)