[tormatic] Use .value() for checked optional access in read_gate_status_ (#16121)
This commit is contained in:
1 parent
0a497d3c22
commit
2bd28eee9d
1 file changed
+3
-2
@@ -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.
|
||||
if (this->available() < this->pending_hdr_->payload_size()) {
|
||||
if (this->available() < hdr.payload_size()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto hdr = *this->pending_hdr_;
|
||||
this->pending_hdr_.reset();
|
||||
|
||||
switch (hdr.type) {
|
||||
|
||||
Reference in new issue
Block a user