Skip to content

Commit

Permalink
Minor logic change
Browse files Browse the repository at this point in the history
SVCS-499
  • Loading branch information
TomBaxter committed Dec 21, 2017
1 parent 4c64591 commit b235eb1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions waterbutler/core/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,11 @@ def size_as_int(self) -> int:
Some providers give metadata as an int. Both exist to maintain backwards
compatibility.
"""
if self.size is not None:
return int(self.size)
else:
return None
try:
size_as_int = int(self.size)
except (TypeError, ValueError):
size_as_int = None
return size_as_int


class BaseFileRevisionMetadata(metaclass=abc.ABCMeta):
Expand Down

0 comments on commit b235eb1

Please sign in to comment.