diff --git a/src/WinSW.Core/WinSW.Core.csproj b/src/WinSW.Core/WinSW.Core.csproj index c499823..5ffd4ae 100644 --- a/src/WinSW.Core/WinSW.Core.csproj +++ b/src/WinSW.Core/WinSW.Core.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/WinSW/Program.cs b/src/WinSW/Program.cs index 44e6b5f..5d0bd44 100644 --- a/src/WinSW/Program.cs +++ b/src/WinSW/Program.cs @@ -1055,9 +1055,9 @@ namespace WinSW DateTime fileLastWriteTime = File.GetLastWriteTime(config.FullPath); using RegistryKey? registryKey = Registry.LocalMachine - .OpenSubKey("SYSTEM") - .OpenSubKey("CurrentControlSet") - .OpenSubKey("Services") + .OpenSubKey("SYSTEM")? + .OpenSubKey("CurrentControlSet")? + .OpenSubKey("Services")? .OpenSubKey(config.Name); if (registryKey is null)