Fix crash due to missing pointer validation
authorLoic Blot <loic.blot@unix-experience.fr>
Sun, 2 Jul 2017 20:26:25 +0000 (22:26 +0200)
committersfan5 <sfan5@live.de>
Sun, 10 Jun 2018 15:18:11 +0000 (17:18 +0200)
Based on commit 014a1a0

src/game.cpp

index facc68aeaaca452eb7ad0b06c69d31840627c9e9..5ad93b95aba37878508590977d024d8cb8005bbd 100644 (file)
@@ -170,7 +170,8 @@ struct LocalFormspecHandler : public TextDest
                }
 
                // Don't disable this part when modding is disabled, it's used in builtin
-               m_client->getScript()->on_formspec_input(m_formname, fields);
+               if (m_client && m_client->getScript())
+                       m_client->getScript()->on_formspec_input(m_formname, fields);
        }
 
        Client *m_client;