Skip to content

Commit

Permalink
Update pscap.py
Browse files Browse the repository at this point in the history
Fix for crash
  • Loading branch information
sriram-sp122 committed Jun 17, 2023
1 parent c8167ff commit ff94722
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Arkthor/Core/pscap.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,10 @@ def intimate_completion(fjson, url_prefix):
try:
d = json.load(open(fjson))

event = BytesIO(json.dumps(max(d, key=lambda ev: ev['severity'])).encode())
try:
event = BytesIO(json.dumps(max(d, key=lambda ev: ev['severity'])).encode())
except KeyError:
event = BytesIO(json.dumps(d))
event.seek(0)

print(fjson)
Expand Down

0 comments on commit ff94722

Please sign in to comment.