From 1364329886c27afb05d713c7571b652670dcee8a Mon Sep 17 00:00:00 2001 From: samcake Date: Tue, 15 Dec 2015 22:07:06 -0800 Subject: [PATCH] FIxing the compil bug by checking security of the call with assert and avoiding the compilation error --- libraries/render/src/render/DrawTask.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/libraries/render/src/render/DrawTask.h b/libraries/render/src/render/DrawTask.h index 52dc427251..ab102e32a7 100755 --- a/libraries/render/src/render/DrawTask.h +++ b/libraries/render/src/render/DrawTask.h @@ -86,19 +86,13 @@ public: template T& edit() { auto theConcept = std::dynamic_pointer_cast(_concept); - if (theConcept) { - return theConcept->_data; - } - assert(false); - return T(); + assert(theConcept); + return theConcept->_data; } template const T& get() const { auto theConcept = std::dynamic_pointer_cast(_concept); - if (theConcept) { - return theConcept->_data; - } - assert(false); - return T(); + assert(theConcept); + return theConcept->_data; } void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {