summaryrefslogtreecommitdiffstats
path: root/src/render/picking/qobjectpicker.cpp
diff options
context:
space:
mode:
authorSvenn-Arne Dragly <s@dragly.com>2016-08-02 13:53:45 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-08-02 12:00:22 +0000
commite768ed1d5943c7e3fcc70fa0eb525bf735171835 (patch)
tree8e2527d0f3bd4bb73cf97bd0fd982118f98d0b2e /src/render/picking/qobjectpicker.cpp
parentf24f85c718543cc51663ac2fe55eb3a3b50628ec (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.cpp2
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) {