summaryrefslogtreecommitdiffstats
path: root/src/Bindings/ManualBindings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Bindings/ManualBindings.cpp')
-rw-r--r--src/Bindings/ManualBindings.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index f4764447c..0558533ce 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -697,8 +697,12 @@ static int tolua_ForEachInBox(lua_State * tolua_S)
Ty1 * Self = NULL;
cBoundingBox * Box = NULL;
L.GetStackValues(1, Self, Box);
- ASSERT(Self != NULL); // We have verified the type at the top, so we should get valid objects here
- ASSERT(Box != NULL);
+ if ((Self == NULL) || (Box == NULL))
+ {
+ LOGWARNING("Invalid world (%p) or boundingbox (%p)", Self, Box);
+ L.LogStackTrace();
+ return 0;
+ }
// Create a reference for the function:
cLuaState::cRef FnRef(L, 3);
@@ -1156,7 +1160,7 @@ static int tolua_cWorld_QueueTask(lua_State * tolua_S)
return lua_do_error(tolua_S, "Error in function call '#funcname#': Could not get function reference of parameter #1");
}
- self->QueueTask(new cLuaWorldTask(*Plugin, FnRef));
+ self->QueueTask(make_unique<cLuaWorldTask>(*Plugin, FnRef));
return 0;
}