瀏覽代碼

raconverter 处理nsnull

Ray Zhang 7 年之前
父節點
當前提交
42187b56ee
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      common/RAConvertor.m

+ 1 - 1
common/RAConvertor.m

@@ -111,7 +111,7 @@ begin:
 +(NSDictionary*) string2dict:(NSString*) str
 {
     
-    if(str==nil)
+    if(str==nil||(NSNull *)str==[NSNull null])
         return nil;
     NSError *error = nil;
     NSDictionary *string2dic = [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding:NSUTF8StringEncoding]