diff --git a/ArduSub/RC_Channel.h b/ArduSub/RC_Channel.h index 52b33c9d53..7b7139a1e9 100644 --- a/ArduSub/RC_Channel.h +++ b/ArduSub/RC_Channel.h @@ -19,7 +19,7 @@ public: RC_Channel_Sub obj_channels[NUM_RC_CHANNELS]; RC_Channel_Sub *channel(const uint8_t chan) override { - if (chan > NUM_RC_CHANNELS) { + if (chan >= NUM_RC_CHANNELS) { return nullptr; } return &obj_channels[chan];