Skip to content

Commit

Permalink
Update amalgamation file
Browse files Browse the repository at this point in the history
  • Loading branch information
kunitoki authored and actions-user committed Mar 19, 2023
1 parent 6f0ed45 commit 220ba91
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Distribution/LuaBridge/LuaBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -4472,7 +4472,8 @@ struct Stack<std::optional<T>>

[[nodiscard]] static TypeResult<Type> get(lua_State* L, int index)
{
if (lua_type(L, index) == LUA_TNIL)
const auto type = lua_type(L, index);
if (type == LUA_TNIL || type == LUA_TNONE)
return std::nullopt;

auto result = Stack<T>::get(L, index);
Expand All @@ -4484,7 +4485,8 @@ struct Stack<std::optional<T>>

[[nodiscard]] static bool isInstance(lua_State* L, int index)
{
return lua_isnil(L, index) || Stack<T>::isInstance(L, index);
const auto type = lua_type(L, index);
return (type == LUA_TNIL || type == LUA_TNONE) || Stack<T>::isInstance(L, index);
}
};

Expand Down

0 comments on commit 220ba91

Please sign in to comment.