From 6ff4b06095d01a270ac66211ab444e57e863f232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 1 Aug 2013 19:26:39 +0200 Subject: [PATCH] SceneGraph: add just-to-be-sure assertion. Now we have references all over the place, let's trust pointers even less. --- src/SceneGraph/Object.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SceneGraph/Object.hpp b/src/SceneGraph/Object.hpp index f2a2bf2d9..67ee09f69 100644 --- a/src/SceneGraph/Object.hpp +++ b/src/SceneGraph/Object.hpp @@ -163,6 +163,7 @@ template void Object::setClean() { template auto Object::doTransformationMatrices(const std::vector*>& objects, const MatrixType& initialTransformationMatrix) const -> std::vector { std::vector*> castObjects(objects.size()); for(std::size_t i = 0; i != objects.size(); ++i) + /* Non-null is checked in transformations() */ /** @todo Ensure this doesn't crash, somehow */ castObjects[i] = static_cast*>(objects[i]); @@ -201,6 +202,8 @@ template std::vector Ob /* Mark all original objects as joints and create initial list of joints from them */ for(std::size_t i = 0; i != objects.size(); ++i) { + CORRADE_INTERNAL_ASSERT(objects[i]); + /* Multiple occurences of one object in the array, don't overwrite it with different counter */ if(objects[i]->counter != 0xFFFFu) continue;