From e79d067690c4dd833416e790e497431cd549dce4 Mon Sep 17 00:00:00 2001 From: Hugo Fonseca Date: Sat, 7 Mar 2015 19:01:54 +0000 Subject: [PATCH] Make parseJson safer --- src/Composer/Json/JsonFile.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Composer/Json/JsonFile.php b/src/Composer/Json/JsonFile.php index b514e5b43..cf9dea5f4 100644 --- a/src/Composer/Json/JsonFile.php +++ b/src/Composer/Json/JsonFile.php @@ -253,6 +253,9 @@ class JsonFile */ public static function parseJson($json, $file = null) { + if (null === $json) { + return; + } $data = json_decode($json, true); if (null === $data && JSON_ERROR_NONE !== json_last_error()) { self::validateSyntax($json, $file);