shipperhq / module-shipper

Base ShipperHQ Repo
Open Software License 3.0
21 stars 21 forks source link

If backup carrier returns no results, page 500 errors #67

Closed navarr closed 4 years ago

navarr commented 5 years ago
[2019-10-04 13:05:24] report.CRITICAL: Report ID: webapi-5d974394135b0; Message: Warning: count(): Parameter must be an array or an object that implements Countable in /app/6ac4x5zgwg74c_stg2/vendor/shipperhq/module-shipper/src/Model/Carrier/Processor/BackupCarrier.php on line 96 {"exception":"[object] (Exception(code: 0): Report ID: webapi-5d974394135b0; Message: Warning: count(): Parameter must be an array or an object that implements Countable in /app/6ac4x5zgwg74c_stg2/vendor/shipperhq/module-shipper/src/Model/Carrier/Processor/BackupCarrier.php on line 96 at /app/6ac4x5zgwg74c_stg2/vendor/magento/framework/Webapi/ErrorProcessor.php:208, Exception(code: 0): Warning: count(): Parameter must be an array or an object that implements Countable in /app/6ac4x5zgwg74c_stg2/vendor/shipperhq/module-shipper/src/Model/Carrier/Processor/BackupCarrier.php on line 96 at /app/6ac4x5zgwg74c_stg2/vendor/magento/framework/App/ErrorHandler.php:61)"} []

In Model\Carrier\Processor\BackupCarrier,

        $result = $carrier->collectRates($rawRequest);
        $this->shipperLogger->postInfo(
            'Shipperhq_Shipper',
            'Backup carrier result: ',
            'returned ' . count($result) . ' results'
        );

If $result is NULL, the page 500s. There should be an NPE check here.

wsajason commented 4 years ago

Hi, Thank you for raising. This has been passed to our developers for further analysis.

wsajason commented 4 years ago

Hi. This has been resolved in v20.34.1. Installing the latest version will resolve.