forked from github/server
22483 Dereference after null check
This commit is contained in:
parent
c68829029b
commit
f83e71e99a
1 changed files with 2 additions and 4 deletions
|
@ -193,11 +193,9 @@ static int tolua_building_create(lua_State * L)
|
|||
const char *bname = tolua_tostring(L, 2, 0);
|
||||
if (!r) {
|
||||
log_error("building.create expects a region as argument 1");
|
||||
}
|
||||
if (!bname) {
|
||||
} else if (!bname) {
|
||||
log_error("building.create expects a name as argument 2");
|
||||
}
|
||||
if (bname) {
|
||||
} else {
|
||||
const building_type *btype = bt_find(bname);
|
||||
if (btype) {
|
||||
building *b = new_building(btype, r, default_locale);
|
||||
|
|
Loading…
Reference in a new issue