We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8056754 commit 2734da2Copy full SHA for 2734da2
src/GettextPOGenerator.php
@@ -179,7 +179,10 @@ private function addStringsFromJsonFiles($translations)
179
180
// Load each JSON file to get source strings
181
foreach ($this->JsonFiles() as $jsonFile) {
182
- $jsonTranslations = json_decode(file_get_contents($jsonFile), true);
+ $jsonTranslations = json_decode(file_get_contents($jsonFile), true);
183
+ if (!is_array($jsonTranslations)) {
184
+ throw new \Exception("The file '$jsonFile' is not valid JSON.'");
185
+ }
186
187
foreach ($jsonTranslations as $key => $value) {
188
$sourceStrings[] = $key;
0 commit comments