projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
369177a
)
Check NULL pointer properly in some new code trying to log new stuff
author
Perttu Ahola
<celeron55@gmail.com>
Sun, 16 Oct 2011 15:50:30 +0000
(18:50 +0300)
committer
Perttu Ahola
<celeron55@gmail.com>
Sun, 16 Oct 2011 15:50:30 +0000
(18:50 +0300)
src/server.cpp
patch
|
blob
|
history
diff --git
a/src/server.cpp
b/src/server.cpp
index a4b6fe649d8d897e4591a02f287bf3f357ffb4bd..33c3b59b300413c63132712dcf5dacaafaa7e295 100644
(file)
--- 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<<player->getName()<<" crafts "
- <<item
->getName()
<<std::endl;
+ <<item
name
<<std::endl;
}
/*
If the craftresult is placed on itself, move it to