Skip to content

Commit 40bcd55

Browse files
author
Tony Cabello
committed
future proofed the code
1 parent deea9f9 commit 40bcd55

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/js/tabs/gps.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@ TABS.gps.initialize = function (callback) {
9090
}
9191
} else {
9292
// M8N/M9N on newer firmware
93-
for (let i = 0; i < FC.GPS_DATA.chn.length; i++) {
93+
94+
let channels = FC.GPS_DATA.chn.length;
95+
if (channels > 32) {
96+
channels = 32; //the list in html can only show 32 channels but future firmware could send more
97+
}
98+
99+
for (let i = 0; i < channels; i++) {
94100
const row = eSsTable.eq(i);
95101

96102
if (FC.GPS_DATA.chn[i] <= 6) {

0 commit comments

Comments
 (0)