1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-18 13:55:14 +03:00

Fix array overflow in receiver when no active channels

This commit is contained in:
Miguel Angel Mulero Martinez 2019-10-31 09:16:19 +01:00
parent 1547294c0e
commit 90dc937e74

View file

@ -464,6 +464,9 @@ TABS.receiver.initialize = function (callback) {
} }
function update_ui() { function update_ui() {
if (RC.active_channels > 0) {
// update bars with latest data // update bars with latest data
for (var i = 0; i < RC.active_channels; i++) { for (var i = 0; i < RC.active_channels; i++) {
meter_fill_array[i].css('width', ((RC.channels[i] - meter_scale.min) / (meter_scale.max - meter_scale.min) * 100).clamp(0, 100) + '%'); meter_fill_array[i].css('width', ((RC.channels[i] - meter_scale.min) / (meter_scale.max - meter_scale.min) * 100).clamp(0, 100) + '%');
@ -482,6 +485,8 @@ TABS.receiver.initialize = function (callback) {
} }
} }
}
// update required parts of the plot // update required parts of the plot
widthScale = d3.scale.linear(). widthScale = d3.scale.linear().
domain([(samples - 299), samples]); domain([(samples - 299), samples]);