Skip to content

Commit 5323d80

Browse files
committedNov 21, 2013
Fix possible implicit conversion of NULL to std::string
1 parent 98e4e2b commit 5323d80

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/script/common/c_internal.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ int script_error_handler(lua_State *L) {
5757

5858
void script_error(lua_State *L)
5959
{
60-
throw LuaError(NULL, lua_tostring(L, -1));
60+
const char *s = lua_tostring(L, -1);
61+
std::string str(s ? s : "");
62+
throw LuaError(NULL, str);
6163
}
6264

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

0 commit comments

Comments
 (0)
Please sign in to comment.