Skip to content

Commit

Permalink
fix host error
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 5, 2024
1 parent 265cdaf commit da8d174
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bbot/scanner/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def get(self, event, single=True, **kwargs):
host = event.host
else:
raise ValueError(f"Invalid host/event: {event} ({type(event)})")
if not host:
if kwargs.get("raise_error", False):
raise KeyError(f"Host not found: '{event}'")
return None
results = super().get(host, **kwargs)
if results and single:
return next(iter(results))
Expand Down

0 comments on commit da8d174

Please sign in to comment.