diff --git a/ecospheres_migrator/geonetwork.py b/ecospheres_migrator/geonetwork.py index 38bcd00..ce6f297 100644 --- a/ecospheres_migrator/geonetwork.py +++ b/ecospheres_migrator/geonetwork.py @@ -211,7 +211,7 @@ def update_record( r = self.session.post(f"{self.api}/records/{uuid}/editor", data=data) r.raise_for_status() - if state.stage == WorkflowStage.APPROVED: + if state and state.stage == WorkflowStage.APPROVED: # If the record was already approved, transparently approve the working copy # we created above when updating the record. r = self.session.put(