From 4ee9cf7aad7cafb4a544fa2d921c629954129384 Mon Sep 17 00:00:00 2001 From: edouard Date: Thu, 23 Dec 2010 22:28:24 +0000 Subject: [PATCH] GCS/Config gadget: problem with GCS crashing on input channel assignement should be fixed. Was triggered whenever no input channel was assigned to flight mode, as Corvus found out, thanks! git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2277 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/config/configservowidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/src/plugins/config/configservowidget.cpp b/ground/src/plugins/config/configservowidget.cpp index e25853db5..442af3d46 100644 --- a/ground/src/plugins/config/configservowidget.cpp +++ b/ground/src/plugins/config/configservowidget.cpp @@ -912,7 +912,7 @@ void ConfigServoWidget::updateChannels(UAVObject* controlCommand) // Find the channel currently assigned to flightmode field = obj->getField("FlightMode"); int chIndex = field->getOptions().indexOf(field->getValue().toString()); - if ( chIndex < field->getOptions().length()) { + if ( chIndex < field->getOptions().length()-1) { float valueScaled; int chMin = inSliders.at(chIndex)->minimum(); int chMax = inSliders.at(chIndex)->maximum();