diff options
author | Svenn-Arne Dragly <s@dragly.com> | 2016-08-02 13:53:45 +0200 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2016-08-02 12:00:22 +0000 |
commit | e768ed1d5943c7e3fcc70fa0eb525bf735171835 (patch) | |
tree | 8e2527d0f3bd4bb73cf97bd0fd982118f98d0b2e /src/render/picking/qobjectpicker.cpp | |
parent | f24f85c718543cc51663ac2fe55eb3a3b50628ec (diff) |
Check if parentEntity exists in propagateEvent
Currently we check if parent exists,
but we are using parentEntity.
This causes the application to crash
if the entity has a nullptr parentEntity.
Change-Id: I4864cccfc80b4296fceea2445a7eb8f548471363
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/picking/qobjectpicker.cpp')
-rw-r--r-- | src/render/picking/qobjectpicker.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/render/picking/qobjectpicker.cpp b/src/render/picking/qobjectpicker.cpp index 29912fa79..1842b7fee 100644 --- a/src/render/picking/qobjectpicker.cpp +++ b/src/render/picking/qobjectpicker.cpp @@ -313,7 +313,7 @@ void QObjectPickerPrivate::propagateEvent(QPickEvent *event, EventType type) if (!m_entities.isEmpty()) { Qt3DCore::QEntity *entity = m_entities.first(); Qt3DCore::QEntity *parentEntity = nullptr; - while (entity != nullptr && entity->parent() != nullptr && !event->isAccepted()) { + while (entity != nullptr && entity->parentEntity() != nullptr && !event->isAccepted()) { parentEntity = entity->parentEntity(); const auto components = parentEntity->components(); for (Qt3DCore::QComponent *c : components) { |