Skip to content

Commit

Permalink
Don't call containsKey when locale is null (Locastic#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-sainthillier authored Apr 17, 2023
1 parent 1b3510b commit 94afdf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Model/TranslatableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function getTranslations(): Collection
public function hasTranslation(TranslationInterface $translation): bool
{
return isset($this->translationsCache[$translation->getLocale()])
|| $this->translations->containsKey($translation->getLocale());
|| (null !== $translation->getLocale() && $this->translations->containsKey($translation->getLocale()));
}

/**
Expand Down

0 comments on commit 94afdf4

Please sign in to comment.