lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello,

Reading example in https://www.lua.org/pil/28.2.html, I guessed that luaL_checkudata() only return a NULL pointer if the argument doesn't match an user data of the given type.
But unfortunately, it raise a fatal error :

My code is

...
        } else if( (r = luaL_checkudata(L, -1, "SelSharedFunc")) )
            func = *r;

        puts("bla bla"); ...

but puts() is never reached if the argument is not matching and raise following error :

Selenites/MQTT.sel:53: bad argument #-2 to 'Subscribe' (SelSharedFunc expected, got nil)

Did I misunderstood the documentation or there is another problem ?

Thanks

Laurent