From: Perttu Ahola Date: Sun, 16 Oct 2011 15:50:30 +0000 (+0300) Subject: Check NULL pointer properly in some new code trying to log new stuff X-Git-Tag: 0.3.dev-20111021~44 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=96b2d1fd298d54eed84061645a22b49fbc0f3051;p=oweals%2Fminetest.git Check NULL pointer properly in some new code trying to log new stuff --- diff --git a/src/server.cpp b/src/server.cpp index a4b6fe649..33c3b59b3 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3045,8 +3045,11 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) player->inventory.getList("craftresult"); assert(list); InventoryItem *item = list->getItem(0); + std::string itemname = "NULL"; + if(item) + itemname = item->getName(); actionstream<getName()<<" crafts " - <getName()<