[Fix] object is NSNull.
This commit is contained in:
parent
90be2f74ac
commit
3cb2c6d514
@ -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: "\\\"")
|
||||
|
Loading…
x
Reference in New Issue
Block a user