selection: prevent use after free crash
This is hiding a bigger issue in the way changes are propagated through the code, but it should stop an annoying crash in 5.0 from happening. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a6ba598e9a
commit
2fd0cd4ea1
@ -377,6 +377,9 @@ void StatsView::replotIfVisible()
|
||||
|
||||
void StatsView::divesSelected(const QVector<dive *> &dives)
|
||||
{
|
||||
if (dive_table.nr <= 0)
|
||||
// there are no dives, don't bother (this can happen during reset, for example)
|
||||
return;
|
||||
if (isVisible()) {
|
||||
for (auto &series: series)
|
||||
series->divesSelected(dives);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user