Skip to content

Commit 884a24a

Browse files
committed
avoid 502 on creating preprint version from rejected version
1 parent 9bff958 commit 884a24a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

osf/models/preprint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def check_unfinished_or_unpublished_version(self):
407407
"""Check and return the "initiated but unfinished version" and "unfinished or unpublished version".
408408
"""
409409
last_not_rejected_version = self.get_last_not_rejected_version()
410-
if last_not_rejected_version.date_published:
410+
if not last_not_rejected_version or last_not_rejected_version.date_published:
411411
return None, None
412412
if last_not_rejected_version.machine_state == 'initial':
413413
return last_not_rejected_version, None

0 commit comments

Comments
 (0)