forked from github/server
CID 22475 Dereference after null check
This commit is contained in:
parent
04b5bc0c60
commit
0be8724093
|
@ -250,11 +250,15 @@ static int tolua_message_faction(lua_State * L)
|
|||
unit *sender = (unit *)tolua_tousertype(L, 1, 0);
|
||||
faction *target = (faction *)tolua_tousertype(L, 2, 0);
|
||||
const char *str = tolua_tostring(L, 3, 0);
|
||||
if (!target)
|
||||
if (!target) {
|
||||
tolua_error(L, TOLUA_CAST "target is nil", NULL);
|
||||
if (!sender)
|
||||
}
|
||||
else if (!sender) {
|
||||
tolua_error(L, TOLUA_CAST "sender is nil", NULL);
|
||||
}
|
||||
else {
|
||||
deliverMail(target, sender->region, sender, str, NULL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue