Skip to content

Commit

Permalink
Merge pull request #24 from akinozgen/pr-fix-for-empty-lang-file
Browse files Browse the repository at this point in the history
Fix crashing when encountered empty file
  • Loading branch information
LarsWiegers authored Feb 9, 2023
2 parents 13db4d2 + fbb3a93 commit d75eaeb
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ public function handleFile($languageDir, $langFile): void
$lines = include($langFile);
}

if (!is_array($lines)) {
$this->warn("Skipping file (" . $langFile . ") because it is empty.");
return;
}

foreach ($lines as $index => $line) {
if (is_array($line)) {
foreach ($line as $index2 => $line2) {
Expand Down

0 comments on commit d75eaeb

Please sign in to comment.