Commit 775f447f authored by David黄金龙's avatar David黄金龙

处理一处可能的crash

parent 88608de4
...@@ -196,17 +196,20 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource { ...@@ -196,17 +196,20 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHUploadCertificateDetailVC() let vc = YHUploadCertificateDetailVC()
//
if let model = viewModel.uploadCertificateDataListModel { if let model = viewModel.uploadCertificateDataListModel {
var tmp : YHUploadCertificateModel? var tmp : YHUploadCertificateModel?
if indexPath.section == 0 { if indexPath.section == 0 {
tmp = model.small_whites[indexPath.row - 1] if model.small_whites.count > 0,indexPath.row - 1 < model.small_whites.count {
vc.detailType = .SmallWhiteNote tmp = model.small_whites[indexPath.row - 1]
vc.detailType = .SmallWhiteNote
}
} else if indexPath.section == 1 { } else if indexPath.section == 1 {
tmp = model.id_cards[indexPath.row - 1] if model.id_cards.count > 0,indexPath.row - 1 < model.id_cards.count {
vc.detailType = .HongKongCard tmp = model.id_cards[indexPath.row - 1]
vc.detailType = .HongKongCard
}
} }
if let tmp = tmp { if let tmp = tmp {
vc.dataModel = tmp vc.dataModel = tmp
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment