From 8d791390ff3a6e46b373789b7b0dbf174e4c7cb7 Mon Sep 17 00:00:00 2001 From: tangziwen Date: Tue, 19 May 2015 14:47:28 +0800 Subject: [PATCH] fix crash when visiting camera is not exist --- cocos/3d/CCSprite3D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 6337f5f670..ec68085693 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -701,7 +701,7 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) { #if CC_USE_CULLING // camera clipping - if(!Camera::getVisitingCamera()->isVisibleInFrustum(&this->getAABB())) + if(Camera::getVisitingCamera() && !Camera::getVisitingCamera()->isVisibleInFrustum(&this->getAABB())) return; #endif