diff --git a/catcli/noder.py b/catcli/noder.py index 701bd2d..e4b42a0 100644 --- a/catcli/noder.py +++ b/catcli/noder.py @@ -319,7 +319,8 @@ class Noder: out.append(utils.human(node.size)) # size out.append(utils.epoch_to_str(storage.ts)) # indexed_at - out.append(utils.epoch_to_str(node.maccess)) # maccess + if self._has_attr(node, 'maccess'): + out.append(utils.epoch_to_str(node.maccess)) # maccess if node.md5: out.append(node.md5) # md5 else: diff --git a/catcli/utils.py b/catcli/utils.py index 798e784..aa41421 100644 --- a/catcli/utils.py +++ b/catcli/utils.py @@ -52,6 +52,8 @@ def human(size): def epoch_to_str(epoch): '''convert epoch to string''' + if not epoch: + return '' fmt = '%Y-%m-%d %H:%M:%S' t = datetime.datetime.fromtimestamp(float(epoch)) return t.strftime(fmt)