Skip to content

Commit a24700b

Browse files
committed
Exception handling
Fixes #697
1 parent 8e626f1 commit a24700b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

classes/ThemeScanner.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,16 @@ protected function scanThemeConfigForMessagesInternal(Theme $theme)
107107
return false;
108108
}
109109

110-
$translator = Translator::instance();
111110
$keys = [];
112-
113111
foreach ($config as $locale => $messages) {
114112
if (is_string($messages)) {
115113
// $message is a yaml filename, load the yaml file
116114
$messages = $theme->getConfigArray('translate.'.$locale);
117115
}
118-
$keys = array_merge($keys, array_keys($messages));
116+
117+
if (is_array($messages)) {
118+
$keys = array_merge($keys, array_keys($messages));
119+
}
119120
}
120121

121122
Message::importMessages($keys);
@@ -125,7 +126,10 @@ protected function scanThemeConfigForMessagesInternal(Theme $theme)
125126
// $message is a yaml filename, load the yaml file
126127
$messages = $theme->getConfigArray('translate.'.$locale);
127128
}
128-
Message::importMessageCodes($messages, $locale);
129+
130+
if (is_array($messages)) {
131+
Message::importMessageCodes($messages, $locale);
132+
}
129133
}
130134
}
131135

0 commit comments

Comments
 (0)