mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix a crash when no trip exists
When there are no trips at all, we have to skip the Yearly statistics alltogether, including the header line (that should display all the dives added together). Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f7efc07817
commit
5a1a25a476
2 changed files with 1 additions and 2 deletions
|
@ -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]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue