From 96b2d1fd298d54eed84061645a22b49fbc0f3051 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 16 Oct 2011 18:50:30 +0300 Subject: [PATCH] Check NULL pointer properly in some new code trying to log new stuff --- src/server.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server.cpp b/src/server.cpp index a4b6fe64..33c3b59b 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()<