Fixed a bug that segfaulted on if too few entries
authorVisa Putkinen <visa.putkinen@iki.fi>
Wed, 30 Mar 2011 11:05:06 +0000 (14:05 +0300)
committerVisa Putkinen <visa.putkinen@iki.fi>
Wed, 30 Mar 2011 11:05:06 +0000 (14:05 +0300)
weightgraph/weightgraphview.cpp

index a9d93e1..4e0d65f 100644 (file)
@@ -152,7 +152,7 @@ void WeightGraphView::paintEvent(QPaintEvent *)
   }
 
   // Interpolate to fill gap in left part of the graph
-  if (weights.first().date != f && beforeFirst != NULL) {
+  if (weights.size() >= 2 && weights.first().date != f && beforeFirst != NULL) {
     DW dw;
     dw.date = f;
     dw.weight = (weights.first().weight - beforeFirst->weight)