From 2b7f34515a837ea02ebd19be3326b490f33ad012 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 31 Oct 2014 19:25:31 +0100 Subject: [PATCH] cLuaState: Fixed errors on non-existent callbacks. This mostly affected table-based callbacks, such as the cLineBlockTracer. If a callback didn't exist, the code would still push its arguments on the stack, breaking the next callback. --- src/Bindings/LuaState.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h index d1e9923b4..c13e36188 100644 --- a/src/Bindings/LuaState.h +++ b/src/Bindings/LuaState.h @@ -247,7 +247,11 @@ public: template bool Call(const FnT & a_Function, Args &&... args) { - PushFunction(a_Function); + if (!PushFunction(a_Function)) + { + // Pushing the function failed + return false; + } return PushCallPop(args...); }