comparison ServerMonitor/Objects/Server.cs @ 24:06ff59b59e70

Fix not being able to enable a server with a blank SSH key even if it has no SSH checks.
author Brad Greco <brad@bgreco.net>
date Thu, 30 May 2019 21:40:57 -0400
parents 68d7834dc28e
children b5502ce8cb1f
comparison
equal deleted inserted replaced
23:3866c19535fd 24:06ff59b59e70
137 set 137 set
138 { 138 {
139 // Do not allow enabling the server if the private key is not accessible. 139 // Do not allow enabling the server if the private key is not accessible.
140 // Do not fire the EnabledChanged event if the Enabled state is not actually changing 140 // Do not fire the EnabledChanged event if the Enabled state is not actually changing
141 // from its existing value. 141 // from its existing value.
142 if ((LoginType == LoginType.PrivateKey && PrivateKeyFile == null && value == true) || value == _enabled) 142 if ((LoginType == LoginType.PrivateKey && PrivateKeyFile == null && value == true && Checks.Any(c => c is SshCheck)) || value == _enabled)
143 return; 143 return;
144 _enabled = value; 144 _enabled = value;
145 EnabledChanged?.Invoke(this, new EventArgs()); 145 EnabledChanged?.Invoke(this, new EventArgs());
146 } 146 }
147 } 147 }