Pārlūkot izejas kodu

Update Json.php

Replacing test on null with catch exception and rethrow the right Zend_Config_Exception - related to #144 (#150)
Siad Ardroumli 12 gadi atpakaļ
vecāks
revīzija
9e041f0124
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 3 3
      library/Zend/Config/Json.php

+ 3 - 3
library/Zend/Config/Json.php

@@ -128,9 +128,9 @@ class Zend_Config_Json extends Zend_Config
         }
 
         // Parse/decode
-        $config = Zend_Json::decode($json);
-
-        if (null === $config) {
+        try {
+            $config = Zend_Json::decode($json);
+        } catch (Zend_Json_Exception $e) {
             // decode failed
             require_once 'Zend/Config/Exception.php';
             throw new Zend_Config_Exception("Error parsing JSON data");