From 10de7485319b45adf7fdc92e938ad6ed106d6960 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Sun, 21 Jan 2024 13:05:02 -0800 Subject: [PATCH] DatabaseViewer: Fixed seg fault on Mac when opening db --- guilib/src/StatsToolBox.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/guilib/src/StatsToolBox.cpp b/guilib/src/StatsToolBox.cpp index ce0daf3f..6a7e5863 100644 --- a/guilib/src/StatsToolBox.cpp +++ b/guilib/src/StatsToolBox.cpp @@ -528,15 +528,18 @@ void StatsToolBox::clear() plots[0]->clearData(); } else - { - UERROR(""); - } - } - QList items = _statBox->currentWidget()->findChildren(); - for (int i = 0; iclearCache(); - } + { + UERROR(""); + } + } + if(_statBox->currentWidget()) + { + QList items = _statBox->currentWidget()->findChildren(); + for (int i = 0; iclearCache(); + } + } } void StatsToolBox::contextMenuEvent(QContextMenuEvent * event) @@ -567,7 +570,7 @@ void StatsToolBox::contextMenuEvent(QContextMenuEvent * event) } } - if(!plotName.isEmpty()) + if(!plotName.isEmpty() && _statBox->currentWidget()) { QList items = _statBox->currentWidget()->findChildren(); for(int i=0; i