summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-06-12 18:11:40 +0200
committerMattes D <github@xoft.cz>2016-06-27 20:51:52 +0200
commit257c5a1a54396a3610f63bf469d6cf50ec76aef5 (patch)
treef4609bd58206783c9809455f5567cc4aa2ef512d /src/Bindings/LuaState.cpp
parentLuaState: Implemented proper locking for cCallback. (diff)
downloadcuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.tar
cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.tar.gz
cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.tar.bz2
cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.tar.lz
cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.tar.xz
cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.tar.zst
cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.zip
Diffstat (limited to 'src/Bindings/LuaState.cpp')
-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);
}