19 lines
655 B
Diff
19 lines
655 B
Diff
diff --git a/src/region/dynamic_channel_plans/mod.rs b/src/region/dynamic_channel_plans/mod.rs
|
|
index 00f9a5d..33f545a 100644
|
|
--- a/src/region/dynamic_channel_plans/mod.rs
|
|
+++ b/src/region/dynamic_channel_plans/mod.rs
|
|
@@ -55,7 +55,12 @@ impl<
|
|
if channel < NUM_JOIN_CHANNELS {
|
|
Some(R::join_channels()[channel])
|
|
} else {
|
|
- self.additional_channels[channel - NUM_JOIN_CHANNELS]
|
|
+ let index = channel - NUM_JOIN_CHANNELS;
|
|
+ if index < self.additional_channels.len() {
|
|
+ self.additional_channels[index]
|
|
+ } else {
|
|
+ None
|
|
+ }
|
|
}
|
|
}
|
|
|