Fix another instance of silly use of CRM_Utils_Array::value
authoreileen <emcnaughton@wikimedia.org>
Mon, 9 Mar 2020 01:25:42 +0000 (14:25 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 9 Mar 2020 03:20:15 +0000 (16:20 +1300)
Civi/API/Subscriber/ChainSubscriber.php

index 37c8688a4c86b73fec14eb660cc01ef497c28634..031d05b77a7887c52d2e5d4a657e4cb99f468cf3 100644 (file)
@@ -54,7 +54,7 @@ class ChainSubscriber implements EventSubscriberInterface {
     $apiRequest = $event->getApiRequest();
     if ($apiRequest['version'] < 4) {
       $result = $event->getResponse();
-      if (\CRM_Utils_Array::value('is_error', $result, 0) == 0) {
+      if (!is_array($result) || ($result['is_error'] ?? 0) == 0) {
         $this->callNestedApi($event->getApiKernel(), $apiRequest['params'], $result, $apiRequest['action'], $apiRequest['entity'], $apiRequest['version']);
         $event->setResponse($result);
       }