mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 04:53:24 +00:00
Handle dives without samples correctly
The code in commit f99e1b476b18 "Trim the dive to exclude surface time at beginning and end" failed rather badly if a dive has no samples at all - which is true for many of our test dives. This makes sure that we don't exclude data points if we never set up start and end times. Reported-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7fc1213aab
commit
ec042222f0
1 changed files with 2 additions and 1 deletions
|
@ -1706,7 +1706,8 @@ static struct plot_info *create_plot_info(struct dive *dive, int nr_samples, str
|
|||
int delay = 0;
|
||||
struct sample *sample = dive_sample+i;
|
||||
|
||||
if (sample->time.seconds < dive->start || sample->time.seconds > dive->end) {
|
||||
if ((dive->start > -1 && sample->time.seconds < dive->start) ||
|
||||
(dive->end > -1 && sample->time.seconds > dive->end)) {
|
||||
pi_idx--;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue