diff --git a/monkey/common/event_serializers/pydantic_event_serializer.py b/monkey/common/event_serializers/pydantic_event_serializer.py index 692a3cea8..263e3463b 100644 --- a/monkey/common/event_serializers/pydantic_event_serializer.py +++ b/monkey/common/event_serializers/pydantic_event_serializer.py @@ -15,7 +15,7 @@ class PydanticEventSerializer(IEventSerializer, Generic[T]): self._event_class = event_class def serialize(self, event: T) -> JSONSerializable: - if not issubclass(event.__class__, self._event_class): + if not isinstance(event, self._event_class): raise TypeError(f"Event object must be of type: {self._event_class.__name__}") return event.dict(simplify=True)