cluster/serializer/broker: Fix handler lookup

Handler overwrites operator bool, so need to explicitly test for nullptr
rather than not having any handlers defined.
This commit is contained in:
Arne Welzel 2025-01-10 18:03:35 +01:00
parent 24ee115bbc
commit 6d1259423e
6 changed files with 76 additions and 1 deletions

View file

@ -76,7 +76,7 @@ std::optional<detail::Event> to_zeek_event(const broker::zeek::Event& ev) {
zeek::Args vl;
zeek::EventHandlerPtr handler = zeek::event_registry->Lookup(name);
if ( ! handler ) {
if ( handler == nullptr ) {
zeek::reporter->Error("Failed to lookup handler for '%s'", std::string(name).c_str());
return std::nullopt;
}