Add a check to getProperty for unknown properties. (#493)

This commit is contained in:
Umbreon
2021-10-28 06:09:20 +01:00
committed by GitHub
parent 75542dacb3
commit e136529ff0

View File

@@ -40,6 +40,13 @@ local function getProperty(instance, propertyName)
})
end
if err.kind == RbxDom.Error.Kind.Roblox and err.extra:find("is not a valid member of") then
return false, Error.new(Error.UnknownProperty, {
className = instance.ClassName,
propertyName = propertyName,
})
end
return false, Error.new(Error.OtherPropertyError, {
className = instance.ClassName,
propertyName = propertyName,