Remove unnecessary try/catch per #17729
authorColeman Watts <coleman@civicrm.org>
Tue, 14 Jul 2020 00:07:17 +0000 (20:07 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 14 Jul 2020 00:09:36 +0000 (20:09 -0400)
CRM/Utils/Check/Component.php

index 68536908600c7447411f5afdb662845acf82061f..fcd06ca051aa8d2239ed51a456817bb20ae12fc8 100644 (file)
@@ -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;
   }