Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
Prevent "Undefined array key" warning in isFeatureEnabled()
Browse files Browse the repository at this point in the history
  • Loading branch information
drjayvee authored Jan 26, 2023
1 parent 615856f commit ae7e579
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function getFeatureFlag(
if (!$flagWasEvaluatedLocally && !$onlyEvaluateLocally) {
try {
$featureFlags = $this->fetchFeatureVariants($distinctId, $groups, $personProperties, $groupProperties);
$result = $featureFlags[$key];
$result = $featureFlags[$key] ?? null;
} catch (Exception $e) {
error_log("[PostHog][Client] Unable to get feature variants:" . $e->getMessage());
$result = null;
Expand Down

0 comments on commit ae7e579

Please sign in to comment.