Fix crash on wielditem/item entities
authorsfan5 <sfan5@live.de>
Sat, 28 Mar 2020 11:56:48 +0000 (12:56 +0100)
committersfan5 <sfan5@live.de>
Sat, 28 Mar 2020 11:56:48 +0000 (12:56 +0100)
bug was introduced in f3032a637c53f3c98fbbed1d3b691898aabe1687

src/client/content_cao.cpp

index 30b1b82122ec5cbe69dc32ce574b57de0d116495..d148df522e9054693919b338dd7bc2d7947d0293 100644 (file)
@@ -829,7 +829,8 @@ void GenericCAO::setNodeLight(u8 light)
        if (m_prop.visual == "wielditem" || m_prop.visual == "item") {
                // Since these types of visuals are using their own shader
                // they should be handled separately
-               m_wield_meshnode->setColor(color);
+               if (m_wield_meshnode)
+                       m_wield_meshnode->setColor(color);
        } else if (m_enable_shaders) {
                scene::ISceneNode *node = getSceneNode();