diff --git a/ios/Classes/JsonUtil.swift b/ios/Classes/JsonUtil.swift index 5c005d6..fe6d684 100644 --- a/ios/Classes/JsonUtil.swift +++ b/ios/Classes/JsonUtil.swift @@ -3,9 +3,15 @@ import Foundation public class JsonUtil { public static func toString(object: AnyObject?)->String { + + if object is NSNull { + return "" + } + if object == nil { return "" } + if object is String{ let s = object as! String let b = s.replacingOccurrences(of: "\"", with: "\\\"")