From af228c053925821c00710ebb8475f854cb024a3d Mon Sep 17 00:00:00 2001 From: Koncord Date: Thu, 3 Jan 2019 04:26:01 +0800 Subject: [PATCH] [Server] Fix mono_free_method(NULL) error --- apps/openmw-mp/Script/LangMono/LangMono.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; }