Skip to content

Commit 220ba91

Browse files
kunitokiactions-user
authored andcommitted
Update amalgamation file
1 parent 6f0ed45 commit 220ba91

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Distribution/LuaBridge/LuaBridge.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)