summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/render/framegraph/qcameraselector.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/render/framegraph/qcameraselector.cpp b/src/render/framegraph/qcameraselector.cpp
index 37df26beb..d2bc671ca 100644
--- a/src/render/framegraph/qcameraselector.cpp
+++ b/src/render/framegraph/qcameraselector.cpp
@@ -91,7 +91,7 @@ void QCameraSelector::setCamera(Qt3DCore::QEntity *camera)
// Or not previously added as a child of the current node so that
// 1) The backend gets notified about it's creation
// 2) When the current node is destroyed, it gets destroyed as well
- if (!camera->parent())
+ if (camera && !camera->parent())
camera->setParent(this);
emit cameraChanged();
}