Fix a potential crash in the Omni-Rig interface

Misconfiguration of the PTT Method could cause a null pointer
dereference.
This commit is contained in:
Bill Somerville 2019-08-08 13:25:28 +01:00
parent c3346b25c2
commit 518aa0c8eb
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F

View File

@ -662,10 +662,9 @@ void OmniRigTransceiver::do_ptt (bool on)
port_->SetDtr (on);
}
}
else
else if (wrapped_)
{
TRACE_CAT ("OmniRigTransceiver", "set PTT using basic transceiver");
Q_ASSERT (wrapped_);
TransceiverState new_state {wrapped_->state ()};
new_state.ptt (on);
wrapped_->set (new_state, 0);