QmlDesigner: Fix Q_ASSERT

instanceForObject(item) will assert if the instance does not
exist. We already do check if the instance is actually valid.

Change-Id: I0b0ef37d7db3d1e4195504ee8e5f92243bb26d83
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Thomas Hartmann
2022-10-19 16:03:22 +02:00
parent c23564c337
commit e2706436a9

View File

@@ -400,7 +400,9 @@ QImage Qt5NodeInstanceServer::grabItem([[maybe_unused]] QQuickItem *item)
if (!isLayerEnabled(pItem))
pItem->refFromEffectItem(false);
ServerNodeInstance instance = instanceForObject(item);
ServerNodeInstance instance;
if (hasInstanceForObject(item))
instance = instanceForObject(item);
const bool rootIs3DObject = rootIsRenderable3DObject();