Even if passed a default value, getattr throws a DoesNotExist exception when getting a null fk field of a model. Using hasattr() first ensures that an ApiFieldError will be thrown in this case, as it should be.