From da0fd870d837dffd81f47d66464bd7cd5ada736b Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Wed, 24 Jan 2024 11:22:22 -0500 Subject: [PATCH] avoid crash --- CRM/Core/Form.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 7b0c9167b9..fcab41b3c2 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -2111,8 +2111,13 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return mixed */ public function getVar($name) { - if (!empty(ReflectionUtils::getCodeDocs((new ReflectionProperty($this, $name)), 'Property')['deprecated'])) { - CRM_Core_Error::deprecatedWarning('deprecated property accessed :' . $name); + try { + if (!empty(ReflectionUtils::getCodeDocs((new ReflectionProperty($this, $name)), 'Property')['deprecated'])) { + CRM_Core_Error::deprecatedWarning('deprecated property accessed :' . $name); + } + } + catch (\ReflectionException $e) { + // If the variable isn't defined you can't access its properties to check if it's deprecated. Let php 8.2 deal with those warnings. } // @todo - add warnings for internal properties & protected properties. return $this->$name; -- 2.25.1