From 260d4361562285e5b8d854d96f6a97ca86fd76a6 Mon Sep 17 00:00:00 2001 From: peabody124 Date: Tue, 31 Aug 2010 02:11:19 +0000 Subject: [PATCH] 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 --- ground/src/plugins/scope/scopegadgetoptionspage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ground/src/plugins/scope/scopegadgetoptionspage.cpp b/ground/src/plugins/scope/scopegadgetoptionspage.cpp index ad14d65c1..29b4d5a74 100644 --- a/ground/src/plugins/scope/scopegadgetoptionspage.cpp +++ b/ground/src/plugins/scope/scopegadgetoptionspage.cpp @@ -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);