Skip to content

Commit

Permalink
return [] if exception when getting version file bytes size
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmwatson committed Aug 20, 2024
1 parent 6ac294c commit faedbc7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pmg/models/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ def latest_version_for_indexing(self):
if not version:
# don't return None
return []
return base64.encodestring(version.file.get_bytes())
try:
return base64.encodestring(version.file.get_bytes())
except AttributeError as e:
return []

def to_dict(self, include_related=False):
tmp = serializers.model_to_dict(self, include_related=include_related)
Expand Down

0 comments on commit faedbc7

Please sign in to comment.