From 6a91621f1058dfe167bcbdc4f02c59fb04f9d379 Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Sun, 20 Oct 2013 23:05:26 -0400 Subject: [PATCH] Warn on unset or nil command in RunCommands --- src/Actor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Actor.cpp b/src/Actor.cpp index 65eea12ff8..eea8c8d9f5 100644 --- a/src/Actor.cpp +++ b/src/Actor.cpp @@ -1109,11 +1109,16 @@ void Actor::AddRotationR( float rot ) void Actor::RunCommands( const LuaReference& cmds, const LuaReference *pParamTable ) { + if( !cmds.IsSet() || cmds.IsNil() ) + { + LOG->Warn( "RunCommands: command is unset or nil" ); + return; + } + Lua *L = LUA->Get(); // function cmds.PushSelf( L ); - ASSERT( !lua_isnil(L, -1) ); // 1st parameter this->PushSelf( L );