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

QmlDesigner.nodeinstanes: crash fix

We have to check if there is a model. Might be detached, already!
parent 56445230
...@@ -839,6 +839,9 @@ AddImportCommand NodeInstanceView::createImportCommand(const Import &import) ...@@ -839,6 +839,9 @@ AddImportCommand NodeInstanceView::createImportCommand(const Import &import)
void NodeInstanceView::valuesChanged(const ValuesChangedCommand &command) void NodeInstanceView::valuesChanged(const ValuesChangedCommand &command)
{ {
if (!model())
return;
QList<QPair<ModelNode, QString> > valuePropertyChangeList; QList<QPair<ModelNode, QString> > valuePropertyChangeList;
foreach(const PropertyValueContainer &container, command.valueChanges()) { foreach(const PropertyValueContainer &container, command.valueChanges()) {
...@@ -856,7 +859,10 @@ void NodeInstanceView::valuesChanged(const ValuesChangedCommand &command) ...@@ -856,7 +859,10 @@ void NodeInstanceView::valuesChanged(const ValuesChangedCommand &command)
} }
void NodeInstanceView::pixmapChanged(const PixmapChangedCommand &command) void NodeInstanceView::pixmapChanged(const PixmapChangedCommand &command)
{ {
if (!model())
return;
QSet<ModelNode> renderImageChangeSet; QSet<ModelNode> renderImageChangeSet;
foreach (const ImageContainer &container, command.images()) { foreach (const ImageContainer &container, command.images()) {
...@@ -875,6 +881,9 @@ void NodeInstanceView::pixmapChanged(const PixmapChangedCommand &command) ...@@ -875,6 +881,9 @@ void NodeInstanceView::pixmapChanged(const PixmapChangedCommand &command)
void NodeInstanceView::informationChanged(const InformationChangedCommand &command) void NodeInstanceView::informationChanged(const InformationChangedCommand &command)
{ {
if (!model())
return;
QList<ModelNode> informationChangedList; QList<ModelNode> informationChangedList;
foreach(const InformationContainer &container, command.informations()) { foreach(const InformationContainer &container, command.informations()) {
...@@ -898,6 +907,9 @@ void NodeInstanceView::statePreviewImagesChanged(const StatePreviewImageChangedC ...@@ -898,6 +907,9 @@ void NodeInstanceView::statePreviewImagesChanged(const StatePreviewImageChangedC
void NodeInstanceView::childrenChanged(const ChildrenChangedCommand &command) void NodeInstanceView::childrenChanged(const ChildrenChangedCommand &command)
{ {
if (!model())
return;
QList<ModelNode> childNodeList; QList<ModelNode> childNodeList;
foreach(qint32 instanceId, command.childrenInstances()) { foreach(qint32 instanceId, command.childrenInstances()) {
......
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