Commit b851b5c4 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.nodeInstances: fixing isValid for NodeInstance

We have to check also for the ModelNode, but we also have to avoid
recursion.

Reviewed-by: Marco Bubke
parent cdf031c8
...@@ -82,7 +82,7 @@ NodeInstance &NodeInstance::operator=(const NodeInstance &other) ...@@ -82,7 +82,7 @@ NodeInstance &NodeInstance::operator=(const NodeInstance &other)
ModelNode NodeInstance::modelNode() const ModelNode NodeInstance::modelNode() const
{ {
if (isValid()) { if (d) {
return d->modelNode; return d->modelNode;
} else { } else {
return ModelNode(); return ModelNode();
...@@ -100,7 +100,7 @@ qint32 NodeInstance::instanceId() const ...@@ -100,7 +100,7 @@ qint32 NodeInstance::instanceId() const
bool NodeInstance::isValid() const bool NodeInstance::isValid() const
{ {
return instanceId() >= 0; return instanceId() >= 0 && modelNode().isValid();
} }
void NodeInstance::makeInvalid() void NodeInstance::makeInvalid()
......
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