[tormatic] Use .value() for checked optional access in read_gate_status_ (#16121)

This commit is contained in:
Jonathan Swoboda
2026-04-29 09:51:31 -04:00
committed by GitHub
parent 0a497d3c22
commit 2bd28eee9d
@@ -282,12 +282,13 @@ optional<GateStatus> Tormatic::read_gate_status_() {
} }
} }
auto hdr = this->pending_hdr_.value();
// Wait for all payload bytes to arrive before processing. // Wait for all payload bytes to arrive before processing.
if (this->available() < this->pending_hdr_->payload_size()) { if (this->available() < hdr.payload_size()) {
return {}; return {};
} }
auto hdr = *this->pending_hdr_;
this->pending_hdr_.reset(); this->pending_hdr_.reset();
switch (hdr.type) { switch (hdr.type) {