summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/models.cpp2
-rw-r--r--statistics.c1
2 files changed, 1 insertions, 2 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 6600bfaf6..e16312845 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -1448,7 +1448,7 @@ void YearlyStatisticsModel::update_yearly_stats()
}
- if (stats_by_trip != NULL ) {
+ if (stats_by_trip != NULL && stats_by_trip[0].is_trip == TRUE) {
YearStatisticsItem *item = new YearStatisticsItem(stats_by_trip[0]);
for (i = 1; stats_by_trip != NULL && stats_by_trip[i].is_trip; ++i) {
YearStatisticsItem *iChild = new YearStatisticsItem(stats_by_trip[i]);
diff --git a/statistics.c b/statistics.c
index 807539f2a..18666bda0 100644
--- a/statistics.c
+++ b/statistics.c
@@ -127,7 +127,6 @@ void process_all_dives(struct dive *dive, struct dive **prev_dive)
memset(stats_monthly, 0, size);
memset(stats_by_trip, 0, size);
stats_yearly[0].is_year = TRUE;
- stats_by_trip[0].is_trip = TRUE;
/* this relies on the fact that the dives in the dive_table
* are in chronological order */