summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/divelist.c b/divelist.c
index 13ed5113f..d105da52e 100644
--- a/divelist.c
+++ b/divelist.c
@@ -852,6 +852,9 @@ void select_dive(int idx)
{
struct dive *dive = get_dive(idx);
if (dive && !dive->selected) {
+ /* never select an invalid dive that isn't displayed */
+ if (dive->dive_tags & DTAG_INVALID && !prefs.display_invalid_dives)
+ return;
dive->selected = 1;
amount_selected++;
selected_dive = idx;