[PATCH] Fix a crash when dive date is epoch

Miika Turkia miika.turkia at gmail.com
Fri Jan 2 22:13:47 PST 2015


With a dive that's date is 1970-01-01, starting at 00:00 the assert
causes subsurface to crash when performing auto grouping. This happens
to be a perfectly valid date, and we might end up getting such dates
when importing dives from other software, so removing the assert.

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 divelist.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/divelist.c b/divelist.c
index 8802aae..ce67414 100644
--- a/divelist.c
+++ b/divelist.c
@@ -655,7 +655,6 @@ void add_dive_to_trip(struct dive *dive, dive_trip_t *trip)
 {
 	if (dive->divetrip == trip)
 		return;
-	assert(trip->when);
 	remove_dive_from_trip(dive, false);
 	trip->nrdives++;
 	dive->divetrip = trip;
-- 
1.9.1



More information about the subsurface mailing list