Fix crash when elements are missing.

This commit is contained in:
Brandon Wright 2018-06-04 10:36:55 -05:00
parent 13769eeccf
commit dbf9bd6616
1 changed files with 5 additions and 3 deletions

View File

@ -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;