throw NRE exception if key is null
MODIFY
WalletWasabi/Helpers/StartupHelper.cs
WalletWasabi/Helpers/StartupHelper.cs
@@ -33,18 +33,18 @@ namespace WalletWasabi.Helpers
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
string keyName = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
- using RegistryKey? key = Registry.CurrentUser.OpenSubKey(keyName, writable: true);
+ using RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, writable: true) ?? throw new NullReferenceException();
if (isWasabiStartsWithOS)
{
string pathToExeFile = Assembly.GetExecutingAssembly().Location;
pathToExeFile = pathToExeFile.Remove(pathToExeFile.Length - 4); // This part has to change if this gets released
pathToExeFile += ".Fluent.Desktop.exe";
- key?.SetValue("WasabiWallet", pathToExeFile);
+ key.SetValue("WasabiWallet", pathToExeFile);
}
else
{
- key?.DeleteValue("WasabiWallet");
+ key.DeleteValue("WasabiWallet");
}
return true;

throw NRE exception if key is null