diff --git a/sol/stack.hpp b/sol/stack.hpp index b08b2b9f..d0e4c4a8 100644 --- a/sol/stack.hpp +++ b/sol/stack.hpp @@ -263,9 +263,7 @@ struct getter { type t = type_of(L, index); if (t == type::nil) return nullptr; - void* udata = lua_touserdata(L, index); - T** obj = static_cast(udata); - return *obj; + return getter{}.get(L, index); } };