Error: Call to a member function getLocale() on null (1)

Permalink
Hello, i have footer.php this simple code:

$Locale = \Concrete\Core\Multilingual\Page\Section\Section::getCurrentSection();
echo $Locale->getLocale();

The language is displayed correctly, but there is an error in the log:
Exception Occurred: /elements/footer.php Call to a member function getLocale() on null (1)

Can you tell me where I make a mistake when everything is displayed correctly?

Version Concrete 5.4.4

I little speak english

 
shahroq replied on at Permalink Reply
shahroq
Hi,
You can find the code for getting active locale here:
https://github.com/shahroq/whale_c5_cheat_sheet#get-active-locale...