Automatic conversion of false value to array deprecation

I use OpenCart version 3.0.7 and PHP 8.1

I get this error:

Unknown: Automatic conversion of false to array is deprecated in
/home/public/musabgbar/storage/modification/catalog/controller/startup/startup.php
on line 133

After refreshing the page the error disappeared. That happens every time I close the browser and reopen it.
Do know how to modify the code?

        if (!$detect && !is_array($languages)) { 
                // Try using language folder to detect the language
                foreach ($browser_languages as $browser_language) {
                    if (array_key_exists(strtolower($browser_language), $languages)) {
                        $detect = strtolower($browser_language);                        
                        break;
                    }
                }
            }