Skip to content

Commit

Permalink
Fix possible implicit conversion of NULL to std::string
Browse files Browse the repository at this point in the history
  • Loading branch information
kwolekr committed Nov 21, 2013
1 parent 98e4e2b commit 5323d80
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/script/common/c_internal.cpp
Expand Up @@ -57,7 +57,9 @@ int script_error_handler(lua_State *L) {


void script_error(lua_State *L) void script_error(lua_State *L)
{ {
throw LuaError(NULL, lua_tostring(L, -1)); const char *s = lua_tostring(L, -1);
std::string str(s ? s : "");
throw LuaError(NULL, str);
} }


// Push the list of callbacks (a lua table). // Push the list of callbacks (a lua table).
Expand Down

0 comments on commit 5323d80

Please sign in to comment.