diff --git a/posthog/api/feature_flag.py b/posthog/api/feature_flag.py index b1d7f433422c3..764e8b1c78638 100644 --- a/posthog/api/feature_flag.py +++ b/posthog/api/feature_flag.py @@ -394,6 +394,12 @@ def validate_filters(self, filters): # mypy cannot tell that self.instance is a FeatureFlag return self.instance.filters + groups = filters.get("groups", []) + if isinstance(groups, list) and len(groups) == 0: + raise serializers.ValidationError( + "Feature flag filters must contain at least one condition set. Empty 'groups' array is not allowed." + ) + aggregation_group_type_index = filters.get("aggregation_group_type_index", None) def properties_all_match(predicate):