Skip to content
Snippets Groups Projects
Commit aec93b0f authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

Fixes crash from restoring empty string as phone

parent 680f7c38
No related branches found
No related tags found
2 merge requests!54Releasing 1.1.4,!50Search UI 2.0
......@@ -130,11 +130,17 @@ public final class Session: SessionType {
let params = try! JSONDecoder().decode(BackupParameters.self, from: Data(report.parameters.utf8))
username = params.username
phone = params.phone
email = params.email
if let paramsPhone = params.phone, !paramsPhone.isEmpty {
phone = paramsPhone
}
if let paramsEmail = params.email, !paramsEmail.isEmpty {
email = paramsEmail
}
}
print(report.parameters)
print("^^^ \(report.parameters)")
guard username!.isEmpty == false else {
fatalError("Trying to restore an account that has no username")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment