summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Bindings/LuaState.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index 85c6c2e12..0d958cc20 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -1021,6 +1021,10 @@ bool cLuaState::GetStackValue(int a_StackPos, cCallback & a_Callback)
bool cLuaState::GetStackValue(int a_StackPos, cCallbackPtr & a_Callback)
{
+ if (a_Callback == nullptr)
+ {
+ a_Callback = std::make_shared<cCallback>();
+ }
return a_Callback->RefStack(*this, a_StackPos);
}