Fix possible NRE when stopping while a patched method is running
This commit is contained in:
@@ -320,6 +320,10 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public DynValue CallLuaFunction(object function, params object[] args)
|
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)
|
lock (lua)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user