We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7eb1ed2 commit 21ff8deCopy full SHA for 21ff8de
lua.c
@@ -115,12 +115,13 @@ static void l_message (const char *pname, const char *msg) {
115
116
/*
117
** Check whether 'status' is not OK and, if so, prints the error
118
-** message on the top of the stack. It assumes that the error object
119
-** is a string, as it was either generated by Lua or by 'msghandler'.
+** message on the top of the stack.
120
*/
121
static int report (lua_State *L, int status) {
122
if (status != LUA_OK) {
123
const char *msg = lua_tostring(L, -1);
+ if (msg == NULL)
124
+ msg = "(error message not a string)";
125
l_message(progname, msg);
126
lua_pop(L, 1); /* remove message */
127
}
0 commit comments