From e98bc3bdb24a1dfb992759f20ca8cb219802bb1e Mon Sep 17 00:00:00 2001 From: Igor Nikolaev Date: Thu, 12 Mar 2020 08:18:28 +0300 Subject: [PATCH] Catch exception in Cloner::setValue(). --- CHANGELOG.md | 2 ++ Cloner/Cloner.php | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99cfce9..a13e90e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -93,3 +93,5 @@ 7.3.5: Add antispam form theme. 7.3.7: Added template for price on request + +7.3.8: Catch exception in Cloner::setValue(). diff --git a/Cloner/Cloner.php b/Cloner/Cloner.php index a5946e6..4af98e5 100644 --- a/Cloner/Cloner.php +++ b/Cloner/Cloner.php @@ -192,8 +192,11 @@ private function setValue(object $object, \ReflectionClass $reflectionClass, str return; } catch (\Exception $ex) { } - - $reflectionProperty = $reflectionClass->getProperty($property); + try { + $reflectionProperty = $reflectionClass->getProperty($property); + } catch (\Exception $ex) { + return; + } $reflectionProperty->setAccessible(true); $reflectionProperty->setValue($object, $value);