Catch AttributeError exception if getattr fails