From 185a0768689374ce2d2703875a855d990c197728 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 13 Jul 2020 20:07:17 -0400 Subject: [PATCH] Remove unnecessary try/catch per #17729 --- CRM/Utils/Check/Component.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/CRM/Utils/Check/Component.php b/CRM/Utils/Check/Component.php index 6853690860..fcd06ca051 100644 --- a/CRM/Utils/Check/Component.php +++ b/CRM/Utils/Check/Component.php @@ -88,19 +88,10 @@ abstract class CRM_Utils_Check_Component { * @throws \Civi\API\Exception\UnauthorizedException */ public function isDisabled($method) { - try { - $checks = $this->getChecksConfig(); - if (!empty($checks[$method])) { - return (bool) empty($checks[$method]['is_active']); - } + $checks = $this->getChecksConfig(); + if (isset($checks[$method]['is_active'])) { + return !$checks[$method]['is_active']; } - catch (PEAR_Exception $e) { - // if we're hitting this, DB migration to 5.19 probably hasn't run yet, so - // is_active doesn't exist. Ignore this error so the status check (which - // might warn about missing migrations!) still renders. - // TODO: remove at some point after 5.19 - } - return FALSE; } -- 2.25.1