From 3943ba773c09cbdf070804116eeb5223ef4eb1fc Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Thu, 21 Sep 2006 07:33:51 +0000 Subject: [PATCH] Fix crash if lua_tostring() returns NULL. (Maybe not accepting NULL in RString wasn't a good idea.) --- stepmania/src/LuaManager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stepmania/src/LuaManager.cpp b/stepmania/src/LuaManager.cpp index d75a33db11..d7cc707515 100644 --- a/stepmania/src/LuaManager.cpp +++ b/stepmania/src/LuaManager.cpp @@ -588,8 +588,7 @@ bool LuaHelpers::RunExpressionS( const RString &str, RString &sOut ) if( lua_isfunction( L, -1 ) ) RageException::Throw( "Result is a function; did you forget \"()\"?" ); - sOut = lua_tostring( L, -1 ); - lua_pop( L, 1 ); + LuaHelpers::Pop( sOut, L ); LUA->Release( L ); return true;