File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -4472,7 +4472,8 @@ struct Stack<std::optional<T>>
44724472
44734473 [[nodiscard]] static TypeResult<Type> get (lua_State* L, int index)
44744474 {
4475- if (lua_type (L, index) == LUA_TNIL)
4475+ const auto type = lua_type (L, index);
4476+ if (type == LUA_TNIL || type == LUA_TNONE)
44764477 return std::nullopt ;
44774478
44784479 auto result = Stack<T>::get (L, index);
@@ -4484,7 +4485,8 @@ struct Stack<std::optional<T>>
44844485
44854486 [[nodiscard]] static bool isInstance (lua_State* L, int index)
44864487 {
4487- return lua_isnil (L, index) || Stack<T>::isInstance (L, index);
4488+ const auto type = lua_type (L, index);
4489+ return (type == LUA_TNIL || type == LUA_TNONE) || Stack<T>::isInstance (L, index);
44884490 }
44894491};
44904492
You can’t perform that action at this time.
0 commit comments