From: demeritcowboy Date: Wed, 24 Jan 2024 16:22:22 +0000 (-0500) Subject: avoid crash X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=da0fd870d837dffd81f47d66464bd7cd5ada736b;p=civicrm-core.git avoid crash --- 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;