mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
GCS_MAVLink: Ensure serial tunnel avoids nullptr
This commit is contained in:
parent
151770f6e7
commit
55f31d628a
@ -80,7 +80,7 @@ void GCS_MAVLINK::handle_serial_control(const mavlink_message_t &msg)
|
||||
stream = port = AP::serialmanager().get_serial_by_id(packet.device - SERIAL_CONTROL_SERIAL0);
|
||||
|
||||
// see if we need to lock mavlink
|
||||
for (uint8_t i=0; i<MAVLINK_COMM_NUM_BUFFERS; i++) {
|
||||
for (uint8_t i=0; i<gcs().num_gcs(); i++) {
|
||||
GCS_MAVLINK *link = gcs().chan(i);
|
||||
if (link == nullptr || link->get_uart() != port) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user