diff --git a/readthedocs/projects/tasks/builds.py b/readthedocs/projects/tasks/builds.py index 0735f018c6e..5dc70fc5f81 100644 --- a/readthedocs/projects/tasks/builds.py +++ b/readthedocs/projects/tasks/builds.py @@ -782,7 +782,7 @@ def after_return(self, status, retval, task_id, args, kwargs, einfo): log.exception("Failed to revoke build api key.", exc_info=True) # Disable scale-in protection on this instance - if self.data.project.has_feature(Feature.SCALE_IN_PROTECTION): + if self.data.project and self.data.project.has_feature(Feature.SCALE_IN_PROTECTION): set_builder_scale_in_protection.delay( build_id=self.data.build_pk, builder=socket.gethostname(),