We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bfee0ea commit 7fe91c4Copy full SHA for 7fe91c4
src/DbTranslatable/IsDbTranslatable.php
@@ -71,6 +71,11 @@ public function getTranslation(?string $locale = null): ?static
71
72
$defaultTranslation = $this->isDefaultTranslation() ? $this : $this->defaultTranslation;
73
74
+ // Return fast if there is no default translation
75
+ if ( ! $defaultTranslation) {
76
+ return null;
77
+ }
78
+
79
// If the requested locale is the same as the default translation's lang, return the default translation
80
if ($defaultTranslation->lang === $locale) {
81
return $defaultTranslation;
0 commit comments