Commit ae0c978e authored by Boudewijn Rempt's avatar Boudewijn Rempt

BUG:344899 Check whether there's a gmic preview widget

This should fix the crash.
parent b6506dca
......@@ -373,7 +373,10 @@ void KisGmicPlugin::createViewportPreview(KisNodeListSP layers, KisGmicFilterSet
dbgPlugins << "created m_smallApplicator " << m_smallApplicator << " and locking image!";
m_view->image()->lock();
QRect canvasRect = m_view->image()->bounds();
QSize previewSize = m_gmicWidget->previewWidget()->size();
QSize previewSize;
if (m_gmicWidget && m_gmicWidget->previewWidget()) {
previewSize = m_gmicWidget->previewWidget()->size();
}
m_smallApplicator->setProperties(canvasRect,previewSize, layers, setting, m_gmicCustomCommands);
connect(m_smallApplicator , SIGNAL(gmicFinished(bool,int,QString)), this, SLOT(slotGmicFinished(bool,int,QString)));
......
......@@ -413,7 +413,10 @@ void KisGmicWidget::switchOptionsWidgetFor(QWidget* widget)
KisFilterPreviewWidget * KisGmicWidget::previewWidget()
{
return m_inputOutputOptions->previewWidget();
if (m_inputOutputOptions) {
return m_inputOutputOptions->previewWidget();
}
return 0;
}
void KisGmicWidget::slotNotImplemented()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment