Skip to content

Commit

Permalink
Fix for segmentation fault on parsing "CAST TRNS" with no item code.
Browse files Browse the repository at this point in the history
  • Loading branch information
sgb committed Oct 25, 2013
1 parent 914b988 commit c0e42d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spells.cpp
Expand Up @@ -627,6 +627,11 @@ void Game::ProcessTransmutation(Unit *u, AString *o, OrdersCheck *pCheck)
order->number = -1;

token = o->gettoken();
if (!token) {
u->Error("CAST: You must specify what you wish to create.");
delete order;
return;
}
if (token->value() > 0) {
order->number = token->value();
delete token;
Expand Down

0 comments on commit c0e42d2

Please sign in to comment.