浏览代码

Update Json.php

Replacing test on null with catch exception and rethrow the right Zend_Config_Exception - related to #144 (#150)
Siad Ardroumli 12 年之前
父节点
当前提交
9e041f0124
共有 1 个文件被更改,包括 3 次插入3 次删除
  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");