mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Check NULL pointer properly in some new code trying to log new stuff
This commit is contained in:
parent
369177aa80
commit
96b2d1fd29
1 changed files with 4 additions and 1 deletions
|
@ -3045,8 +3045,11 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
||||||
player->inventory.getList("craftresult");
|
player->inventory.getList("craftresult");
|
||||||
assert(list);
|
assert(list);
|
||||||
InventoryItem *item = list->getItem(0);
|
InventoryItem *item = list->getItem(0);
|
||||||
|
std::string itemname = "NULL";
|
||||||
|
if(item)
|
||||||
|
itemname = item->getName();
|
||||||
actionstream<<player->getName()<<" crafts "
|
actionstream<<player->getName()<<" crafts "
|
||||||
<<item->getName()<<std::endl;
|
<<itemname<<std::endl;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
If the craftresult is placed on itself, move it to
|
If the craftresult is placed on itself, move it to
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue