From d036df059e0e228775af38471fcef0400cacb78c Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 6 Nov 2025 19:37:12 +0200 Subject: [PATCH] valid usage --- application/Espo/Core/Formula/ArgumentList.php | 4 ++++ application/Espo/Core/Formula/EvaluatedArgumentList.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/application/Espo/Core/Formula/ArgumentList.php b/application/Espo/Core/Formula/ArgumentList.php index 0f7fc2abed..c1c0caf914 100644 --- a/application/Espo/Core/Formula/ArgumentList.php +++ b/application/Espo/Core/Formula/ArgumentList.php @@ -94,6 +94,10 @@ class ArgumentList implements Evaluatable, Iterator, Countable, ArrayAccess, See #[\ReturnTypeWillChange] public function current() { + if (!$this->valid()) { + return null; + } + return $this->getArgumentByIndex($this->position); } diff --git a/application/Espo/Core/Formula/EvaluatedArgumentList.php b/application/Espo/Core/Formula/EvaluatedArgumentList.php index 9c4bd75093..955848973b 100644 --- a/application/Espo/Core/Formula/EvaluatedArgumentList.php +++ b/application/Espo/Core/Formula/EvaluatedArgumentList.php @@ -94,6 +94,10 @@ class EvaluatedArgumentList implements Iterator, Countable, ArrayAccess, Seekabl #[\ReturnTypeWillChange] public function current() { + if (!$this->valid()) { + return null; + } + return $this->getArgumentByIndex($this->position); }