Skip to content

Commit

Permalink
Fix invalid method return value
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Mar 12, 2020
1 parent 9cd4150 commit 66c139d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/DeferredImageStorageFilesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ private function getConfigPath(string $path): string
*/
private function decode(string $contents): array
{
return json_decode($contents, true);
$content = json_decode($contents, true);

if (!\is_array($content)) {
throw new \RuntimeException('Invalid JSON: '.json_last_error_msg());
}

return $content;
}
}

0 comments on commit 66c139d

Please sign in to comment.