mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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
1 changed files with 3 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue