Skip to content

Commit

Permalink
Fix crash when elements are missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
bearoso committed Jun 4, 2018
1 parent 13769ee commit dbf9bd6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cheats2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,12 +743,14 @@ static void S9xLoadCheatsFromBMLNode (bml_node *n)
bml_node *tmp = NULL;

tmp = bml_find_sub(c, "name");
desc = tmp->data;
if (!desc)
if (!tmp)
desc = (char *) "";
else
desc = tmp->data;

tmp = bml_find_sub(c, "code");
code = tmp->data;
if (tmp)
code = tmp->data;

if (bml_find_sub(c, "enabled"))
enabled = true;
Expand Down

0 comments on commit dbf9bd6

Please sign in to comment.