Check for None before assignment
Ref
@@ -825,6 +825,7 @@ class DockerBuildEnvironment(BuildEnvironment):
),
)
self.failure = exc
+ if self.build:
self.build['state'] = BUILD_STATE_FINISHED
raise exc
else:
