diff --git a/src/widgets/capture/capturewidget.cpp b/src/widgets/capture/capturewidget.cpp index 48d8c0aa..1c9fbbaa 100644 --- a/src/widgets/capture/capturewidget.cpp +++ b/src/widgets/capture/capturewidget.cpp @@ -831,8 +831,10 @@ void CaptureWidget::setState(CaptureToolButton* b) } if (m_toolWidget) { m_toolWidget->deleteLater(); - if (m_activeTool->isValid()) { - pushToolToStack(); + if (m_activeTool != nullptr) { + if (m_activeTool->isValid()) { + pushToolToStack(); + } } } if (m_activeButton != b) {