fix: treat null com port as already deactivated

This commit is contained in:
copilot-swe-agent[bot] 2026-06-05 20:46:08 +00:00 committed by GitHub
parent 1681d4e796
commit 148dead020
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -149,7 +149,7 @@ namespace PepperDash.Essentials.Core
public override bool Deactivate()
{
if (Port == null)
return false;
return true;
Port.SerialDataReceived -= Port_SerialDataReceived;
return Port.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;