collector-bank / Checkout-Magento-2

Magento 2 Module for Collector Bank Checkout
MIT License
3 stars 4 forks source link

Carrier Collector should have null check on quote ID #19

Closed stefanfr closed 1 year ago

stefanfr commented 3 years ago

Hi there,

In the Carrier a function is called collectRates where the quote Id is fetched from the first quote item in the cart. However right after logging in and merging the quote this results in a null $quoteId = $quote->getQuoteId();

After this the $method = $this->getMethodForQuote($quoteId); method is called where the $quoteId cannot be null this causes an error right after merging the quote.

There should be a null check between both methods to avoid this error:

if (null === $quoteId) {
    return $result;
}

Could you please consider adding this null check? I'm not sure if this is reproducable via Magento itself but via the API it is.

kristoffer124 commented 1 year ago

Hello,

Thanks for the feedback. This check will be included in next release.v1.0.30.

kristoffer124 commented 1 year ago

Added in todays release: https://github.com/collector-bank/Checkout-Magento-2/releases/tag/v1.0.30