projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98e4e2b
)
Fix possible implicit conversion of NULL to std::string
author
kwolekr
<kwolekr@minetest.net>
Thu, 21 Nov 2013 05:49:32 +0000
(
00:49
-0500)
committer
kwolekr
<kwolekr@minetest.net>
Thu, 21 Nov 2013 05:49:32 +0000
(
00:49
-0500)
src/script/common/c_internal.cpp
patch
|
blob
|
history
diff --git
a/src/script/common/c_internal.cpp
b/src/script/common/c_internal.cpp
index 7415aecb83277d1da868801c054bcce00cb82943..f22e9b0ff948782a4a909d8ae65217333ad75ba1 100644
(file)
--- a/
src/script/common/c_internal.cpp
+++ b/
src/script/common/c_internal.cpp
@@
-57,7
+57,9
@@
int script_error_handler(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).