summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-11 18:21:18 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-11 18:21:18 (GMT)
commit3b922408e2058f32ca4fd893c7aa251052d3e984 (patch)
tree09b08d316bb563152b3e2faf42fdfcafc7af7cc3
parentb71de874ad7f8453bb50c0b1f32bd5d294cd7f98 (diff)
Check index do not crash
-rw-r--r--kstars/tools/altvstime.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/kstars/tools/altvstime.cpp b/kstars/tools/altvstime.cpp
index 2bb9796..ee15095 100644
--- a/kstars/tools/altvstime.cpp
+++ b/kstars/tools/altvstime.cpp
@@ -460,7 +460,11 @@ double AltVsTime::findAltitude( SkyPoint *p, double hour ) {
return p->alt().Degrees();
}
-void AltVsTime::slotHighlight( int row ) {
+void AltVsTime::slotHighlight( int row )
+{
+ if (row < 0)
+ return;
+
int rowIndex = 0;
//highlight the curve of the selected object
for ( int i=0; i<avtUI->View->graphCount(); i++ ) {
@@ -999,7 +1003,7 @@ void AltVsTime::slotUpdateDateLoc() {
else
DayOffset = 0;
- setLSTLimits();
+ setLSTLimits();
slotHighlight( avtUI->PlotList->currentRow() );
avtUI->View->update();