Fix possible NRE when stopping while a patched method is running

This commit is contained in:
peelz
2022-09-15 18:09:32 -04:00
parent 025b840625
commit 8774a33914

View File

@@ -320,6 +320,10 @@ namespace Barotrauma
public DynValue CallLuaFunction(object function, params object[] args)
{
// XXX: `lua` might be null if `LuaCsSetup.Stop()` is called while
// a patched function is still running.
if (lua == null) return null;
lock (lua)
{
try