[Fix] Let's not segfault if outfit isn't found..
This commit is contained in:
parent
62d37ab334
commit
a76a98de2a
@ -1753,6 +1753,7 @@ static int player_parseShip(xmlNodePtr parent, int is_player) {
|
|||||||
int i, n;
|
int i, n;
|
||||||
double fuel;
|
double fuel;
|
||||||
Pilot* ship;
|
Pilot* ship;
|
||||||
|
Outfit* o;
|
||||||
xmlNodePtr node, cur;
|
xmlNodePtr node, cur;
|
||||||
|
|
||||||
xmlr_attr(parent, "name", name);
|
xmlr_attr(parent, "name", name);
|
||||||
@ -1789,7 +1790,9 @@ static int player_parseShip(xmlNodePtr parent, int is_player) {
|
|||||||
n = atoi(q);
|
n = atoi(q);
|
||||||
free(q);
|
free(q);
|
||||||
/* Add the outfit. */
|
/* Add the outfit. */
|
||||||
pilot_addOutfit(ship, outfit_get(xml_get(cur)), n);
|
o = outfit_get(xml_get(cur));
|
||||||
|
if(o != NULL)
|
||||||
|
pilot_addOutfit(ship, o, n);
|
||||||
}
|
}
|
||||||
} while(xml_nextNode(cur));
|
} while(xml_nextNode(cur));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user