diff --git a/apps/openmw/mwlua/objectvariant.hpp b/apps/openmw/mwlua/objectvariant.hpp index 389839da49..238ad7cfaf 100644 --- a/apps/openmw/mwlua/objectvariant.hpp +++ b/apps/openmw/mwlua/objectvariant.hpp @@ -18,8 +18,10 @@ namespace MWLua mVariant.emplace(obj.as()); else if (obj.is()) mVariant.emplace(obj.as()); - else + else if (obj.is()) mVariant.emplace(obj.as()); + else + throw std::runtime_error("Expected game object, got: " + LuaUtil::toString(obj)); } bool isSelfObject() const { return std::holds_alternative(mVariant); }