1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

GCS/Scope: Small bug that prevented adding traces when none exist

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1475 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2010-08-31 02:11:19 +00:00 committed by peabody124
parent 12657440c3
commit 260d436156

View File

@ -244,7 +244,8 @@ void ScopeGadgetOptionsPage::on_btnAddCurve_clicked()
//Find an existing plot curve config based on the uavobject and uav field. If it
//exists, update it, else add a new one.
if(options_page->lstCurves->currentItem()->text() == uavObject + "." + uavField)
if(options_page->lstCurves->count() &&
options_page->lstCurves->currentItem()->text() == uavObject + "." + uavField)
{
QListWidgetItem *listWidgetItem = options_page->lstCurves->currentItem();
setCurvePlotProperties(listWidgetItem,uavObject,uavField,scale,varColor);