Преглед на файлове

fix and prevent force close

alqindiirsyam преди 5 месеца
родител
ревизия
858d280a1e

+ 1 - 1
AppBuilder/AppBuilder/SecondTabViewController.swift

@@ -1417,7 +1417,7 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
             if isFiltering {
                 data = fillteredData[indexPath.row] as! Chat
             } else {
-                if chats.count == 0 {
+                if chats.count == 0 || (indexPath.row > (chats.count - 1)) {
                     let labelNochat = UILabel()
                     labelNochat.text = loadingData ? "Loading Data...".localized() : "There are no conversations".localized()
                     labelNochat.font = .systemFont(ofSize: 13)

BIN
ExampleCode/.DS_Store


+ 5 - 0
NexilisLite/NexilisLite/Source/IncomingThread.swift

@@ -379,6 +379,11 @@ class IncomingThread {
         DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: {
             let onGoingCC: String = SecureUserDefaults.shared.value(forKey: "onGoingCC") ?? ""
             let channelCC: String = SecureUserDefaults.shared.value(forKey: "channelCC") ?? ""
+            if !onGoingCC.isEmpty && onGoingCC.components(separatedBy: ",").count < 3 {
+                SecureUserDefaults.shared.removeValue(forKey: "onGoingCC")
+                SecureUserDefaults.shared.removeValue(forKey: "channelCC")
+                return
+            }
             let complaintId = onGoingCC.isEmpty ? "" : onGoingCC.components(separatedBy: ",")[2]
             let fPinCC = onGoingCC.isEmpty ? "" : onGoingCC.components(separatedBy: ",")[1]
             if fPinCC == User.getMyPin() || fPinCC.isEmpty || complaintId.isEmpty {

+ 2 - 2
NexilisLite/NexilisLite/Source/View/Control/ContactChatViewController.swift

@@ -1152,9 +1152,9 @@ extension ContactChatViewController {
                 if isFilltering {
                     data = fillteredData[indexPath.row] as! Chat
                 } else {
-                    if chats.count == 0 {
+                    if chats.count == 0 || (indexPath.row > (chats.count - 1)) {
                         let labelNochat = UILabel()
-                        labelNochat.text = "There are no conversations".localized()
+                        labelNochat.text = loadingData ? "Loading Data...".localized() : "There are no conversations".localized()
                         labelNochat.font = .systemFont(ofSize: 13)
                         labelNochat.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
                         content.addSubview(labelNochat)