ctrl k
  • BeagleIM/chat/ChatViewDataSource.swift
    ■ ■ ■ ■ ■ ■
    skipped 476 lines
    477 477   }
    478 478  
    479 479   mutating func trim() -> [Int] {
     480 + guard items.count > 100 else {
     481 + return [];
     482 + }
    480 483   let removed = Array(100..<items.count);
    481 484   self.items = Array(items[0..<100]);
    482 485   knownItems = Set(items.map({ it -> Int in return it.id; }));
    skipped 20 lines
  • BeagleIM/groupchat/OpenGroupchatController.swift
    ■ ■ ■ ■ ■ ■
    skipped 458 lines
    459 459   group.enter();
    460 460   discoModule.getItems(for: JID(mucJid), onItemsReceived: { (node, items) in
    461 461   let sortedItems = items.sorted(by: { (i1, i2) -> Bool in
    462  - let n1 = i1.name ?? i1.jid.localPart!;
    463  - let n2 = i2.name ?? i2.jid.localPart!;
     462 + let n1 = i1.name ?? i1.jid.localPart ?? "";
     463 + let n2 = i2.name ?? i2.jid.localPart ?? "";
    464 464   return n1.compare(n2) == ComparisonResult.orderedAscending;
    465 465   })
    466 466   DispatchQueue.main.async {
    skipped 58 lines
  • BeagleIM/settings/AccountsListController.swift
    ■ ■ ■ ■ ■ ■
    skipped 207 lines
    208 208  
    209 209   let regModule = client.modulesManager.register(InBandRegistrationModule());
    210 210   regModule.unregister({ (result) in
    211  - if let account = AccountManager.getAccount(for: jid) {
    212  - _ = AccountManager.delete(account: account);
     211 + DispatchQueue.main.async {
     212 + if let account = AccountManager.getAccount(for: jid) {
     213 + _ = AccountManager.delete(account: account);
     214 + }
    213 215   }
    214 216   })
    215 217   break;
    skipped 98 lines
  • BeagleIM/ui/Markdown.swift
    ■ ■ ■ ■ ■ ■
    skipped 63 lines
    64 64   let c = message[idx];
    65 65   switch c {
    66 66   case ">":
    67  - if quoteStart == nil && idx == message.startIndex || message[message.index(before: idx)] == "\n" {
     67 + if quoteStart == nil && (idx == message.startIndex || message[message.index(before: idx)] == "\n") {
    68 68   let start = idx;
    69 69   while idx != message.endIndex, message[idx] == ">" {
    70 70   idx = message.index(after: idx);
    skipped 136 lines
    207 207   italicStart = nil
    208 208   if (quoteStart != nil) {
    209 209   print("quote level:", quoteLevel);
    210  - msg.addAttribute(.paragraphStyle, value: Markdown.quoteParagraphStyle, range: NSRange(quoteStart!..<idx, in: message));
     210 + if idx <= message.endIndex {
     211 + print("message possibly causing a crash:", message);
     212 + msg.addAttribute(.paragraphStyle, value: Markdown.quoteParagraphStyle, range: NSRange(quoteStart!..<idx, in: message));
     213 + }
    211 214   quoteStart = nil;
    212 215   }
    213 216   }
    skipped 60 lines
Please wait...
Page is in error, reload to recover