1
0
réplica de https://github.com/luanti-org/luanti.git sincronizado 2026-01-08 02:05:34 +01:00

Fix crash due to missing pointer validation

Fix #6092
Este cometimento está contido em:
Loic Blot
2017-07-02 22:26:25 +02:00
ascendente 94c294bfdc
cometimento 014a1a0805

Ver ficheiro

@@ -121,8 +121,7 @@ struct TextDestPlayerInventory : public TextDest
struct LocalFormspecHandler : public TextDest
{
LocalFormspecHandler(const std::string &formname):
m_client(NULL)
LocalFormspecHandler(const std::string &formname)
{
m_formname = formname;
}
@@ -174,10 +173,11 @@ 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;
Client *m_client = nullptr;
};
/* Form update callback */