How did I solve the «Magento\Customer\Model\Address\AbstractAddress\CountryModelsCache::get(): Argument #1 ($key) must be of type string, null given» error caused by the `MageWorx_ShippingRules` module?

The call stack

1. MageWorx\ShippingRules\Block\Cart\LayoutProcessor::resolveAddressData()

2. Magento\Customer\Model\Address\AbstractAddress::getCountryModel()

3. Magento\Customer\Model\Address\AbstractAddress\CountryModelsCache::get()

The MageWorx_ShippingRules module retrieves country information from Magento in an incorrect way:

To solve the problem, I replaced the incorrect MageWorx_ShippingRules code with a call to the df_country() function from my mage2pro/core library: