diff --git a/pGina/src/Shared/Registration/CredProviderManager.cs b/pGina/src/Shared/Registration/CredProviderManager.cs index 6b64166..38ce587 100644 --- a/pGina/src/Shared/Registration/CredProviderManager.cs +++ b/pGina/src/Shared/Registration/CredProviderManager.cs @@ -473,7 +473,8 @@ namespace pGina.CredentialProvider.Registration public override bool Enabled() { using (RegistryKey key = Registry.LocalMachine.OpenSubKey(this.ProviderKey)) - { + { + if (key == null) return false; object value = key.GetValue("Disabled"); if (value == null) return true; else @@ -494,7 +495,8 @@ namespace pGina.CredentialProvider.Registration public override bool Enabled6432() { using (RegistryKey key = Registry.LocalMachine.OpenSubKey(this.ProviderKey6432)) - { + { + if (key == null) return false; object value = key.GetValue("Disabled"); if (value == null) return true; else