[Sputnik-list] Error when creating a new empty lua node
Jérôme Vuarand
jerome.vuarand at gmail.com
Sat Feb 16 00:47:55 GMT+2 2008
Hi list,
Whenever I create an node in Sputnik with the prototype @Lua_Config, I
get an error. A workaround is to create it without prototype, and then
change the prototype.
The error is caused by a loadstring call with a nil argument, I didn't
manage to find why the argument is nil (the stack contained several
tail calls and some anonymous closures), but below is a patch that
seems fix the problem on my website:
diff -urN sputnik-orig/rocks/versium/8.01.01-0/lua/versium/luaenv.lua
sputnik/rocks/versium/8.01.01-0/lua/versium/luaenv.lua
--- sputnik-orig/rocks/versium/8.01.01-0/lua/versium/luaenv.lua
2008-01-01 09:46:19.000000000 -0800
+++ sputnik/rocks/versium/8.01.01-0/lua/versium/luaenv.lua
2008-02-15 17:25:56.000000000 -0800
@@ -12,6 +12,7 @@
end
local function do_lua(lua)
+ if type(lua)~='string' then return nil,"invalid lua code string" end
local f,err = loadstring(lua)
if f then
The do_lua function has another "return nil,'message'", so I did the
same. However my error message didn't show anywhere, maybe it's simply
ignored.
Tell me if there's a better solution.
Bye, Doub.
More information about the Sputnik-list
mailing list