summaryrefslogtreecommitdiffstats
path: root/statistics.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-01 00:19:03 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-01 00:19:03 +1100
commitb709dff23d94b93ffa484a7bfe46441ece79520f (patch)
tree380d57cb8a46ea842671b2061097de632181467c /statistics.c
parent0f2fac265fb876de971a2849bec69c51161d7a74 (diff)
downloadsubsurface-b709dff23d94b93ffa484a7bfe46441ece79520f.tar.gz
Clear yearly statistics when closing data file
Another oversight of what needed to be done when cleaning up the UI after closing the data file. Reported-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'statistics.c')
-rw-r--r--statistics.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/statistics.c b/statistics.c
index fbc4f9273..001c45155 100644
--- a/statistics.c
+++ b/statistics.c
@@ -543,7 +543,8 @@ static void show_single_dive_stats(struct dive *dive)
struct tm tm;
process_all_dives(dive, &prev_dive);
-
+ if (!dive)
+ return;
utc_mkdate(dive->when, &tm);
snprintf(buf, sizeof(buf),
/*++GETTEXT 80 chars: weekday, monthname, day, year, hour, min */