diff options
Diffstat (limited to 'core/divesite.c')
-rw-r--r-- | core/divesite.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/divesite.c b/core/divesite.c index f6e96e3c5..437605b71 100644 --- a/core/divesite.c +++ b/core/divesite.c @@ -130,13 +130,15 @@ struct dive_site *alloc_or_get_dive_site(uint32_t uuid) return ds; } -int nr_of_dives_at_dive_site(uint32_t uuid, bool select_only) +int nr_of_dives_at_dive_site(struct dive_site *ds, bool select_only) { int j; int nr = 0; struct dive *d; + if (!ds) + return 0; for_each_dive(j, d) { - if (d->dive_site_uuid == uuid && (!select_only || d->selected)) { + if (d->dive_site_uuid == ds->uuid && (!select_only || d->selected)) { nr++; } } |