Manos Chorianopoulos

fix getProfile crash

......@@ -1826,7 +1826,8 @@ public class swiftApi {
self.optin_sms_segmentation = optin?["sms_segmentation"] as? Bool? ?? false
// profile_metadata
let profile_metadata_json = dictionary["profile_metadata"] as AnyObject
if let profile_metadata_json = dictionary["profile_metadata"] as? AnyObject {
if ((!(profile_metadata_json is NSNull)) && (profile_metadata_json != nil)) {
var profile_metadata_parsed:[String: Any]
let json = profile_metadata_json.data(using: String.Encoding.utf8.rawValue)
......@@ -1856,6 +1857,22 @@ public class swiftApi {
print(error)
}
} else {
self.profile_metadata = [String: Any]()
self.badge = ""
self.msisdnList = []
self.answered = false
self.nonTelco = false
}
} else {
self.profile_metadata = [String: Any]()
self.badge = ""
self.msisdnList = []
self.answered = false
self.nonTelco = false
}
}
public var _ack_optin: Bool {
......@@ -4730,7 +4747,9 @@ public class swiftApi {
self.date = ""
}
let transaction_metadata_json = dictionary["transaction_metadata"] as AnyObject
if let transaction_metadata_json = dictionary["transaction_metadata"] as? AnyObject {
if ((!(transaction_metadata_json is NSNull)) && (transaction_metadata_json != nil)) {
var transaction_metadata_parsed:[String: Any]
let json = transaction_metadata_json.data(using: String.Encoding.utf8.rawValue)
......@@ -4750,6 +4769,14 @@ public class swiftApi {
self.sender_msisdn = ""
print(error)
}
} else {
self.receiver_msisdn = ""
self.sender_msisdn = ""
}
} else {
self.receiver_msisdn = ""
self.sender_msisdn = ""
}
}
public var _couponset_uuid: String {
......