diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php index b064776f..62156352 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php @@ -1004,10 +1004,13 @@ class RetailCrmHistory if (isset($orderCrm['delivery']['service']['code'])) { $deliveryCode = \Bitrix\Sale\Delivery\Services\Manager::getCodeById($deliveryId); $serviceCode = $orderCrm['delivery']['service']['code']; - $services = \Bitrix\Sale\Delivery\Services\Manager::getService($deliveryId)->getProfilesList(); - if (!array_key_exists($serviceCode, $services)) { - $serviceCode = strtoupper($serviceCode); - $serviceCode = str_replace(array('-'), "_", $serviceCode); + $service = \Bitrix\Sale\Delivery\Services\Manager::getService($deliveryId); + if (is_object($service)) { + $services = $service->getProfilesList(); + if (!array_key_exists($serviceCode, $services)) { + $serviceCode = strtoupper($serviceCode); + $serviceCode = str_replace(array('-'), "_", $serviceCode); + } } if ($deliveryCode) { try {