Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osf/models/preprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def check_unfinished_or_unpublished_version(self):
"""Check and return the "initiated but unfinished version" and "unfinished or unpublished version".
"""
last_not_rejected_version = self.get_last_not_rejected_version()
if last_not_rejected_version.date_published:
if not last_not_rejected_version or last_not_rejected_version.date_published:
return None, None
if last_not_rejected_version.machine_state == 'initial':
return last_not_rejected_version, None
Expand Down