Skip to content

Commit

Permalink
fix emptystrings in cmd_version causing exception
Browse files Browse the repository at this point in the history
  • Loading branch information
pirate committed Feb 9, 2021
1 parent a32eac3 commit a49884a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions archivebox/index/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ def typecheck(self) -> None:
assert isinstance(self.end_ts, datetime)
assert isinstance(self.cmd, list)
assert all(isinstance(arg, str) and arg for arg in self.cmd)
assert self.pwd is None or isinstance(self.pwd, str) and self.pwd
assert self.cmd_version is None or isinstance(self.cmd_version, str) and self.cmd_version
assert self.output is None or isinstance(self.output, (str, Exception))
if isinstance(self.output, str):
assert self.output

# TODO: replace emptystrings in these three with None / remove them from the DB
assert self.pwd is None or isinstance(self.pwd, str)
assert self.cmd_version is None or isinstance(self.cmd_version, str)
assert self.output is None or (isinstance(self.output, (str, Exception))

@classmethod
def guess_ts(_cls, dict_info):
Expand Down

0 comments on commit a49884a

Please sign in to comment.