Browse Source

json_decode returns null on error, not false

Jordi Boggiano 13 years ago
parent
commit
cad0967788
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Composer/Json/JsonFile.php

+ 1 - 1
src/Composer/Json/JsonFile.php

@@ -91,7 +91,7 @@ class JsonFile
     {
         $data = json_decode($json, true);
 
-        if (false === $data && 'false' !== $json) {
+        if (null === $data && 'null' !== strtolower($json)) {
             switch (json_last_error()) {
             case JSON_ERROR_NONE:
                 $msg = 'No error has occurred, is your composer.json file empty?';