fix: null as 2nd param is deprecated (#3801)

This commit is contained in:
IanM 2023-04-19 18:07:10 +01:00 committed by GitHub
parent 1792e22639
commit 8576df1a43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,7 +62,7 @@ class Translator extends BaseTranslator implements TranslatorContract
{
foreach ($catalogue->all() as $domain => $messages) {
foreach ($messages as $id => $translation) {
if (preg_match(self::REFERENCE_REGEX, $translation, $matches)) {
if (! empty($translation) && preg_match(self::REFERENCE_REGEX, $translation, $matches)) {
$catalogue->set($id, $this->getTranslation($catalogue, $id, $domain), $domain);
}
}