Skip to content

Commit 4fea33e

Browse files
authored
[cpp test-windows]46/26 clear mode crash (#19195)
1 parent 6730fd0 commit 4fea33e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2441,7 +2441,8 @@ CameraBackgroundClearTest::CameraBackgroundClearTest()
24412441

24422442
void CameraBackgroundClearTest::switch_CameraClearMode(cocos2d::Ref* sender)
24432443
{
2444-
auto type = _camera->getBackgroundBrush()->getBrushType();
2444+
auto brush = _camera->getBackgroundBrush();
2445+
auto type = brush ? brush->getBrushType() : CameraBackgroundBrush::BrushType::NONE;
24452446
if (type == CameraBackgroundBrush::BrushType::NONE)
24462447
{
24472448
_camera->setBackgroundBrush(CameraBackgroundBrush::createDepthBrush(1.f));

0 commit comments

Comments
 (0)