Skip to content

Commit

Permalink
Fix nullptr dereference in QgsHtmlWidgetWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 13, 2022
1 parent 0c81a2b commit 5b65378
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/editorwidgets/qgshtmlwidgetwrapper.cpp
Expand Up @@ -80,8 +80,11 @@ void QgsHtmlWidgetWrapper::checkGeometryNeeds()
NeedsGeometryEvaluator evaluator;

const QgsAttributeEditorContext attributecontext = context();
const QgsExpressionContext expressionContext = layer()->createExpressionContext();
evaluator.setExpressionContext( expressionContext );
if ( QgsVectorLayer *vl = layer() )
{
const QgsExpressionContext expressionContext = vl->createExpressionContext();
evaluator.setExpressionContext( expressionContext );
}

auto frame = webView.page()->mainFrame();
connect( frame, &QWebFrame::javaScriptWindowObjectCleared, frame, [ frame, &evaluator ]
Expand Down

0 comments on commit 5b65378

Please sign in to comment.