From ed6a81c9e796c3199a1e40538db1cb312c62830b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Mon, 8 Feb 2021 19:52:48 +0100 Subject: [PATCH] Properly fix the areas crash --- src/GUI/gui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/GUI/gui.cpp b/src/GUI/gui.cpp index 8427bd40..327d56b4 100644 --- a/src/GUI/gui.cpp +++ b/src/GUI/gui.cpp @@ -866,8 +866,6 @@ void GUI::loadData(const Data &data) paths = _mapView->loadData(data); GraphTab *gt = static_cast(_graphTabWidget->currentWidget()); - if (!gt) - return; int index = _graphTabWidget->currentIndex(); for (int i = 0; i < paths.count(); i++) { @@ -878,8 +876,10 @@ void GUI::loadData(const Data &data) for (int j = 0; j < graphs.count(); j++) pi->addGraph(graphs.at(j).at(i)); - pi->setGraph(index); - pi->setMarkerPosition(gt->sliderPosition()); + if (gt && index >= 0) { + pi->setGraph(index); + pi->setMarkerPosition(gt->sliderPosition()); + } } }