APIv4 - Add Address::getCoordinates action
[civicrm-core.git] / CRM / Utils / GeocodeProvider.php
index c5df3cac2a851ebbb34087719b154945be61ea0e..5f6a6027a61fc18e5354272c3e33d2e527454f5e 100644 (file)
@@ -68,7 +68,7 @@ class CRM_Utils_GeocodeProvider {
       // or extend a base class. While we identify and implement a geocoding
       // abstraction library (rather than continue to roll our own), we settle for
       // this check.
-      if (!method_exists($provider, 'format') && $provider !== FALSE) {
+      if ($provider !== FALSE && !method_exists($provider, 'format')) {
         Civi::log()->error('Configured geocoder is invalid, must provide a format method', ['geocode_class' => $provider]);
         $provider = FALSE;
       }