aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2015-07-26 18:38:58 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2015-07-26 18:39:06 -0700
commit8cb9d38d66a0791d91be775498a8c17a3b9fac9e (patch)
tree14a3ad3f496fae7151dc691369091e7960d28634 /src
parentfaced02c0562bd3379131f42c61fb1c2d901925d (diff)
Fixed crash on JSON parse error
Diffstat (limited to 'src')
-rw-r--r--src/core/basetypes/MCJSONParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/basetypes/MCJSONParser.cpp b/src/core/basetypes/MCJSONParser.cpp
index d9f68204..31699345 100644
--- a/src/core/basetypes/MCJSONParser.cpp
+++ b/src/core/basetypes/MCJSONParser.cpp
@@ -617,7 +617,9 @@ Object * JSONParser::objectFromString(String * str)
parser->setContent(str);
parser->parse();
result = parser->result();
- result->retain()->autorelease();
+ if (result != NULL) {
+ result->retain()->autorelease();
+ }
parser->release();
return result;