Fixed #21563 -- Raise a subclass of AttributeError when a related object doesn't exist.