[Sputnik-list] Error when creating a new empty lua node
Yuri Takhteyev
yuri at sims.berkeley.edu
Mon Feb 18 08:10:49 GMT+2 2008
Thanks for reporting this. I managed to reproduce it, so I'll try to
track down the underlying problem.
- yuri
On Fri, Feb 15, 2008 at 6:47 PM, Jérôme Vuarand
<jerome.vuarand at gmail.com> wrote:
> 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.
More information about the Sputnik-list
mailing list