diff --git a/apps/openmw-mp/Script/LangMono/LangMono.cpp b/apps/openmw-mp/Script/LangMono/LangMono.cpp index 33a1314ac..5ed6ff8b7 100644 --- a/apps/openmw-mp/Script/LangMono/LangMono.cpp +++ b/apps/openmw-mp/Script/LangMono/LangMono.cpp @@ -345,7 +345,10 @@ void LangMono::LoadProgram(const char *filename) int LangMono::FreeProgram() { for(auto &&method : methodsCache) - mono_free_method(method.second); + { + if(method.second != nullptr) + mono_free_method(method.second); + } return 0; }