We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f0ed45 commit 220ba91Copy full SHA for 220ba91
1 file changed
Distribution/LuaBridge/LuaBridge.h
@@ -4472,7 +4472,8 @@ struct Stack<std::optional<T>>
4472
4473
[[nodiscard]] static TypeResult<Type> get(lua_State* L, int index)
4474
{
4475
- if (lua_type(L, index) == LUA_TNIL)
+ const auto type = lua_type(L, index);
4476
+ if (type == LUA_TNIL || type == LUA_TNONE)
4477
return std::nullopt;
4478
4479
auto result = Stack<T>::get(L, index);
@@ -4484,7 +4485,8 @@ struct Stack<std::optional<T>>
4484
4485
4486
[[nodiscard]] static bool isInstance(lua_State* L, int index)
4487
- return lua_isnil(L, index) || Stack<T>::isInstance(L, index);
4488
4489
+ return (type == LUA_TNIL || type == LUA_TNONE) || Stack<T>::isInstance(L, index);
4490
}
4491
};
4492
0 commit comments