System : Guard null pointer access

This commit is contained in:
Magne Sjaastad 2017-12-08 09:25:25 +01:00
parent 97743e6d70
commit f8e7a8aa26

View File

@ -95,11 +95,14 @@ bool RiuTreeViewEventFilter::eventFilter(QObject *obj, QEvent *event)
// Do not toggle state if currently editing a name in the tree view // Do not toggle state if currently editing a name in the tree view
bool toggleStateForSelection = true; bool toggleStateForSelection = true;
if (RiuMainWindow::instance()->projectTreeView()->isTreeItemEditWidgetActive()) if (RiuMainWindow::instance()->projectTreeView() &&
RiuMainWindow::instance()->projectTreeView()->isTreeItemEditWidgetActive())
{ {
toggleStateForSelection = false; toggleStateForSelection = false;
} }
else if (RiaApplication::instance()->mainPlotWindow() && RiaApplication::instance()->mainPlotWindow()->projectTreeView()->isTreeItemEditWidgetActive()) else if (RiaApplication::instance()->mainPlotWindow() &&
RiaApplication::instance()->mainPlotWindow()->projectTreeView() &&
RiaApplication::instance()->mainPlotWindow()->projectTreeView()->isTreeItemEditWidgetActive())
{ {
toggleStateForSelection = false; toggleStateForSelection = false;
} }