1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-12-23 08:08:47 -05:00

Fixed error reported by cppcheck:

[./server.cpp:1327]: (error) Possible null pointer dereference: obj - otherwise it is redundant to check if obj is null at line 1332
This commit is contained in:
Perttu Ahola 2011-04-11 11:05:40 +03:00
parent 67d5f5c1d5
commit 3f153c20d3

View File

@ -1322,9 +1322,12 @@ void Server::AsyncRunStep()
data_buffer.append(buf, 2);
writeU8((u8*)buf, type);
data_buffer.append(buf, 1);
data_buffer.append(serializeLongString(
obj->getClientInitializationData()));
if(obj)
data_buffer.append(serializeLongString(
obj->getClientInitializationData()));
else
data_buffer.append(serializeLongString(""));
// Add to known objects
client->m_known_objects.insert(i.getNode()->getKey(), false);