Skip to content
Snippets Groups Projects

Issue #3481616: Error in CountryCacheContext if no country is set.

@@ -41,7 +41,9 @@ class CountryCacheContext implements CacheContextInterface {
* {@inheritdoc}
*/
public function getContext() {
return $this->currentCountry->getCountry()->getCountryCode();
// In case the current country cannot be determined, return "none" as the
// cache context.
return $this->currentCountry->getCountry()?->getCountryCode() ?? 'none';
}
/**
Loading