diff --git a/bbot/core/event/base.py b/bbot/core/event/base.py index 8b493b4ae..1fb235bc2 100644 --- a/bbot/core/event/base.py +++ b/bbot/core/event/base.py @@ -1648,6 +1648,8 @@ def make_event( When working within a module's `handle_event()`, use the instance method `self.make_event()` instead of calling this function directly. """ + if not data: + raise ValidationError("No data provided") # allow tags to be either a string or an array if not tags: diff --git a/bbot/test/test_step_1/test_events.py b/bbot/test/test_step_1/test_events.py index 195f08ea8..8b4773bcf 100644 --- a/bbot/test/test_step_1/test_events.py +++ b/bbot/test/test_step_1/test_events.py @@ -611,6 +611,10 @@ async def test_events(events, helpers): assert str(parent_event_3.module) == "mymodule" assert str(parent_event_3.module_sequence) == "mymodule->mymodule->mymodule" + # event with no data + with pytest.raises(ValidationError): + event = scan.make_event(None, "DNS_NAME", parent=scan.root_event) + await scan._cleanup()