summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dive.c b/dive.c
index 4de181c70..fb9c4cec7 100644
--- a/dive.c
+++ b/dive.c
@@ -2906,9 +2906,9 @@ static int split_dive_at(struct dive *dive, int a, int b)
fixup_dive(d1);
fixup_dive(d2);
+ if ((i = get_divenr(dive)) < 0)
+ return 0;
-
- i = get_divenr(dive);
delete_single_dive(i);
add_single_dive(i, d1);