From 94c223b4bda277846557e8b4a70ca4a15b4b5c60 Mon Sep 17 00:00:00 2001 From: AndriiWell <58992820+AndriiWell@users.noreply.github.com> Date: Mon, 3 Feb 2020 19:01:04 +0200 Subject: [PATCH] Update MassEntityAPIHandler.php For case when response is empty. --- src/crm/api/handler/MassEntityAPIHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crm/api/handler/MassEntityAPIHandler.php b/src/crm/api/handler/MassEntityAPIHandler.php index 74288279..da58db9b 100644 --- a/src/crm/api/handler/MassEntityAPIHandler.php +++ b/src/crm/api/handler/MassEntityAPIHandler.php @@ -290,7 +290,7 @@ public function getRecords($param_map,$header_map) $this->addHeader("Content-Type", "application/json"); $responseInstance = APIRequest::getInstance($this)->getBulkAPIResponse(); $responseJSON = $responseInstance->getResponseJSON(); - $records = $responseJSON["data"]; + $records = $responseJSON["data"]??[]; $recordsList = array(); foreach ($records as $record) { $recordInstance = ZCRMRecord::getInstance($this->module->getAPIName(), $record["id"]); @@ -396,4 +396,4 @@ public function constructJSONForMassUpdate($idList, $apiName, $value) "data" => $massUpdateArray ); } -} \ No newline at end of file +}