summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/divelist.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/divelist.c b/core/divelist.c
index ec088a87e..0722953ae 100644
--- a/core/divelist.c
+++ b/core/divelist.c
@@ -1249,11 +1249,13 @@ struct dive *merge_two_dives(struct dive *a, struct dive *b)
void select_dive(struct dive *dive)
{
- if (dive && !dive->selected) {
+ if (!dive)
+ return;
+ if (!dive->selected) {
dive->selected = 1;
amount_selected++;
- current_dive = dive;
}
+ current_dive = dive;
}
void deselect_dive(struct dive *dive)