diff --git a/core/dive.c b/core/dive.c index 1d20e1421..39157f5d0 100644 --- a/core/dive.c +++ b/core/dive.c @@ -3495,8 +3495,11 @@ extern bool cylinder_with_sensor_sample(const struct dive *dive, int cylinder_id { for (const struct divecomputer *dc = &dive->dc; dc; dc = dc->next) { for (int i = 0; i < dc->samples; ++i) { + struct sample *sample = dc->sample + i; for (int j = 0; j < MAX_SENSORS; ++j) { - if (dc->sample[i].sensor[j] == cylinder_id) + if (!sample->pressure[j].mbar) + continue; + if (sample->sensor[j] == cylinder_id) return true; } }