From 76bba1b61c15f6dd3bc977b53acb95d2c31408f2 Mon Sep 17 00:00:00 2001 From: "v.zanfir" Date: Fri, 3 Mar 2023 11:35:53 +0300 Subject: [PATCH] Not call whenInactive when it is null --- src/PendingScopedFeatureInteraction.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PendingScopedFeatureInteraction.php b/src/PendingScopedFeatureInteraction.php index 9bfb712..46ccab2 100644 --- a/src/PendingScopedFeatureInteraction.php +++ b/src/PendingScopedFeatureInteraction.php @@ -208,7 +208,9 @@ public function when($feature, $whenActive, $whenInactive = null) return $whenActive($this->value($feature), $this); } - return $whenInactive($this); + if ($whenInactive !== null) { + return $whenInactive($this); + } } /**