Skip to content

Commit 9d62096

Browse files
authored
Merge pull request #22 from PostHog/fix-possibly-null-percentage
Add condition for rollout-percentage
2 parents d15aac4 + 563404f commit 9d62096

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

posthog/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def feature_enabled(self, key, distinct_id, default=False):
296296
except IndexError:
297297
return default
298298

299-
if feature_flag.get("is_simple_flag"):
299+
if feature_flag.get("is_simple_flag") and feature_flag.get("rollout_percentage"):
300300
response = _hash(key, distinct_id) <= (feature_flag["rollout_percentage"] / 100)
301301
else:
302302
try:

0 commit comments

Comments
 (0)