From af5022d7a839e41b898e8a1d49873308d9f7f0de Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Fri, 1 Nov 2013 21:52:15 -0400 Subject: [PATCH] warn on bad DrawFunction --- src/ActorFrame.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ActorFrame.cpp b/src/ActorFrame.cpp index 9c1bc9141a..dc43140e76 100644 --- a/src/ActorFrame.cpp +++ b/src/ActorFrame.cpp @@ -236,7 +236,11 @@ void ActorFrame::DrawPrimitives() { Lua *L = LUA->Get(); m_DrawFunction.PushSelf( L ); - ASSERT( !lua_isnil(L, -1) ); + if( lua_isnil(L, -1) ) + { + LOG->Warn( "Error compiling DrawFunction" ); + return; + } this->PushSelf( L ); RString sError; if( !LuaHelpers::RunScriptOnStack(L, sError, 1, 0) ) // 1 arg, 0 results