Fix ObjectRef errors due to lua_isnil() (#10564)
Treat 'none' values as 'nil'
This commit is contained in:
@@ -50,5 +50,8 @@ class LuaHelper
|
||||
* @return read value from Lua or default value if nil
|
||||
*/
|
||||
template <typename T>
|
||||
static T readParam(lua_State *L, int index, const T &default_value);
|
||||
static inline T readParam(lua_State *L, int index, const T &default_value)
|
||||
{
|
||||
return lua_isnoneornil(L, index) ? default_value : readParam<T>(L, index);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user