We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b17dfc commit ddcd061Copy full SHA for ddcd061
src/GettextPOGenerator.php
@@ -164,7 +164,10 @@ private function addStringsFromJsonFiles($translations) {
164
165
// Load each JSON file to get source strings
166
foreach ($this->JsonFiles() as $jsonFile) {
167
- $jsonTranslations = json_decode(file_get_contents($jsonFile), true);
+ $jsonTranslations = json_decode(file_get_contents($jsonFile), true);
168
+ if (!is_array($jsonTranslations)) {
169
+ throw new \Exception("The file '$jsonFile' is not valid JSON.'");
170
+ }
171
172
foreach ($jsonTranslations as $key => $value) {
173
$sourceStrings[] = $key;
0 commit comments