Skip to content

Commit 6b10e39

Browse files
authored
Extra guard in case user explicitly requests metadata for ancestor with none (#9)
1 parent 18597b0 commit 6b10e39

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

processinghistory/cmdline/historyview.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ def mainCmd():
5858
if cmdargs.showparents:
5959
displayParents(key, procHist)
6060
else:
61-
metadict = procHist.metadataByKey[key]
62-
displayDict(metadict, cmdargs)
61+
metadict = procHist.metadataByKey.get(key)
62+
if metadict is not None:
63+
displayDict(metadict, cmdargs)
64+
else:
65+
print(f'No history metadata for key "{key}"')
6366

6467

6568
def findAncestorKey(procHist, ancestor):

0 commit comments

Comments
 (0)