Skip to content

Commit 896c0bc

Browse files
authored
[GEN][ZH] Prevent dereferencing NULL pointer 'button' in ScriptActions::doCameoFlash() (#1121)
1 parent b868561 commit 896c0bc

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,6 +2551,7 @@ void ScriptActions::doCameoFlash(const AsciiString& name, Int timeInSeconds)
25512551
if( button == NULL )
25522552
{
25532553
DEBUG_CRASH(( "ScriptActions::doCameoFlash can't find AsciiString cameoflash" ));
2554+
return;
25542555
}
25552556

25562557
Int frames = LOGICFRAMES_PER_SECOND * timeInSeconds;

GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2628,6 +2628,7 @@ void ScriptActions::doCameoFlash(const AsciiString& name, Int timeInSeconds)
26282628
if( button == NULL )
26292629
{
26302630
DEBUG_CRASH(( "ScriptActions::doCameoFlash can't find AsciiString cameoflash" ));
2631+
return;
26312632
}
26322633

26332634
Int frames = LOGICFRAMES_PER_SECOND * timeInSeconds;

0 commit comments

Comments
 (0)