Selaa lähdekoodia

Merge branch 'master' into v2.1

Mike Pall 5 vuotta sitten
vanhempi
commit
8b55054473
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      src/lib_debug.c

+ 2 - 1
src/lib_debug.c

@@ -369,7 +369,8 @@ LJLIB_CF(debug_debug)
       return 0;
     if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") ||
 	lua_pcall(L, 0, 0, 0)) {
-      fputs(lua_tostring(L, -1), stderr);
+      const char *s = lua_tostring(L, -1);
+      fputs(s ? s : "(error object is not a string)", stderr);
       fputs("\n", stderr);
     }
     lua_settop(L, 0);  /* remove eventual returns */