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