Skip to content

Commit

Permalink
Fix null pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
joern-h committed Mar 31, 2022
1 parent 531ce72 commit cc6e7f9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SpaceCadetPinball/TPinballTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ int TPinballTable::Message(int code, float value)
if (PlayerCount <= 1)
{
char* textboxText;
if (Demo->ActiveFlag)
if (Demo && Demo->ActiveFlag)
textboxText = pinball::get_rc_string(30, 0);
else
textboxText = pinball::get_rc_string(26, 0);
Expand Down Expand Up @@ -504,25 +504,25 @@ int TPinballTable::Message(int code, float value)
switch (nextPlayer)
{
case 0:
if (Demo->ActiveFlag)
if (Demo && Demo->ActiveFlag)
textboxText = pinball::get_rc_string(30, 0);
else
textboxText = pinball::get_rc_string(26, 0);
break;
case 1:
if (Demo->ActiveFlag)
if (Demo && Demo->ActiveFlag)
textboxText = pinball::get_rc_string(31, 0);
else
textboxText = pinball::get_rc_string(27, 0);
break;
case 2:
if (Demo->ActiveFlag)
if (Demo && Demo->ActiveFlag)
textboxText = pinball::get_rc_string(32, 0);
else
textboxText = pinball::get_rc_string(28, 0);
break;
case 3:
if (Demo->ActiveFlag)
if (Demo && Demo->ActiveFlag)
textboxText = pinball::get_rc_string(33, 0);
else
textboxText = pinball::get_rc_string(29, 0);
Expand Down

0 comments on commit cc6e7f9

Please sign in to comment.