Skip to content

Commit

Permalink
[cpp test-windows]46/26 clear mode crash (#19195)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatriceJiang committed Nov 21, 2018
1 parent 6730fd0 commit 4fea33e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,8 @@ CameraBackgroundClearTest::CameraBackgroundClearTest()

void CameraBackgroundClearTest::switch_CameraClearMode(cocos2d::Ref* sender)
{
auto type = _camera->getBackgroundBrush()->getBrushType();
auto brush = _camera->getBackgroundBrush();
auto type = brush ? brush->getBrushType() : CameraBackgroundBrush::BrushType::NONE;
if (type == CameraBackgroundBrush::BrushType::NONE)
{
_camera->setBackgroundBrush(CameraBackgroundBrush::createDepthBrush(1.f));
Expand Down

0 comments on commit 4fea33e

Please sign in to comment.