mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02: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:
@@ -1323,8 +1323,11 @@ void Server::AsyncRunStep()
|
||||
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);
|
||||
|
Reference in New Issue
Block a user