From f1cbdec86911c01bc0217e5d5ebc23dae042046b Mon Sep 17 00:00:00 2001 From: Alexander Popel Date: Thu, 10 Aug 2023 15:06:33 +0300 Subject: [PATCH] SetHeaderElement.php: revert try-catch fix This reverts the fix from here: https://github.com/51Degrees/pipeline-php-core/compare/4.4.3.0...main#diff-2c905bd63ed59a54167749f6edb3e917e4742df635975daf813baa9f60e7f3efL155-L159 While the fix itself looks correct, it causes device-detection-php tests to fail, so for now lets revert it. --- SetHeaderElement.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SetHeaderElement.php b/SetHeaderElement.php index a1b6e60..4dd6ab7 100644 --- a/SetHeaderElement.php +++ b/SetHeaderElement.php @@ -152,9 +152,13 @@ public function getPropertyValue($flowData, $elementKey, $propertyKey){ } $propertyKey = strtolower($propertyKey); - if (isset($elementData->$propertyKey)) { + // TODO: catch is never called here. Consider replacing it with: + // if (isset($elementData->$propertyKey)) + // The change can't be made right now, as it causes device-detection-php + // tests to fail. Further investigation is needed. + try { $property = $elementData->$propertyKey; - } else { + } catch (Exception $e) { echo sprintf(Messages::PROPERTY_NOT_FOUND, $propertyKey, $elementKey); return ""; }