forked from qt-creator/qt-creator
QmlDesigner: Fix crash on removing import
If material shown in material editor is provided by the removed import, the selected node in material view becomes invalid. Change-Id: I374e80288b5fe59d4eba63b6712d4c8891fd11cc Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -1917,6 +1917,9 @@ void NodeInstanceView::endNanotrace()
|
|||||||
|
|
||||||
QVariant NodeInstanceView::previewImageDataForGenericNode(const ModelNode &modelNode, const ModelNode &renderNode)
|
QVariant NodeInstanceView::previewImageDataForGenericNode(const ModelNode &modelNode, const ModelNode &renderNode)
|
||||||
{
|
{
|
||||||
|
if (!modelNode.isValid())
|
||||||
|
return {};
|
||||||
|
|
||||||
ModelNodePreviewImageData imageData;
|
ModelNodePreviewImageData imageData;
|
||||||
|
|
||||||
// We need puppet to generate the image, which needs to be asynchronous.
|
// We need puppet to generate the image, which needs to be asynchronous.
|
||||||
|
Reference in New Issue
Block a user