Commit 196350e3 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.propertyEditor: crash fix for gradient editing

parent a877e6cf
......@@ -389,7 +389,7 @@ void ColorBox::mouseMoveEvent(QMouseEvent *e)
void GradientLine::setItemNode(const QVariant &itemNode)
{
if (!itemNode.value<ModelNode>().isValid() || !QmlItemNode(itemNode.value<ModelNode>()).hasNodeParent())
if (!itemNode.value<ModelNode>().isValid())
return;
m_itemNode = itemNode.value<ModelNode>();
setup();
......@@ -442,6 +442,8 @@ void GradientLine::setActiveColor(const QColor &newColor)
void GradientLine::setupGradient()
{
ModelNode modelNode = m_itemNode.modelNode();
if (!modelNode.isValid())
return;
m_colorList.clear();
m_stops.clear();
......
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