SDK 版本
AVOSCloud ~> 11.4.9
AVOSCloudIM ~> 11.4.9
ChatKit ~>2.3.10
崩溃代码:
LCCKContactListViewController.m 文件大概600行,断点停在userName = contact.name ?: contact.clientId;
- (NSMutableDictionary *)sortedSectionForUserNames:(NSSet *)contactsOrUserNames {
NSMutableDictionary *originSections = [NSMutableDictionary dictionary];
[contactsOrUserNames enumerateObjectsUsingBlock:^(id _Nonnull contactOrUserName, BOOL * _Nonnull stop) {
NSString *userName;
LCCKContact *contact;
if ([contactOrUserName isKindOfClass:[NSString class]]) {
userName = (NSString *)contactOrUserName;
} else {
contact = (LCCKContact *)contactOrUserName;
userName = contact.name ?: contact.clientId;
}
NSString *indexKey = [self indexTitleForName:userName];
NSMutableArray *names = originSections[indexKey];
if (!names) {
names = [NSMutableArray array];
originSections[indexKey] = names;
}
[names addObject:contactOrUserName];
}];
return originSections;
}
报错信息:
2019-02-28 11:13:18.214761+0800 ACG[856:176076] -[NSNull name]: unrecognized selector sent to instance 0x240a219a0
2019-02-28 11:13:18.246692+0800 ACG[856:176076] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull name]: unrecognized selector sent to instance 0x240a219a0'
*** First throw call stack:
(0x210d07ef8 0x20fed5a40 0x210c1f154 0x210d0d810 0x210d0f4bc 0x101e34898 0x210c0b144 0x101e3476c 0x101e34da0 0x101e34598 0x101e34e4c 0x101e31800 0x23dd3e0f8 0x23dd503a4 0x23dd50e10 0x23dcf4894 0x23dd17e80 0x101dff55c 0x101e30098 0x101e30404 0x102b476c8 0x23d549380 0x23d5497b0 0x23d4c3220 0x23d4783c4 0x23d4743e8 0x23db18800 0x23db06840 0x23db35b78 0x210c95b94 0x210c90828 0x210c90dc8 0x210c905b8 0x212f04584 0x23db0cbc8 0x1006b8464 0x210750b94)
libc++abi.dylib: terminating with uncaught exception of type NSException
错误线程:
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x000000021089d104 libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x00000002109180e0 libsystem_pthread.dylib`pthread_kill$VARIANT$mp + 380
frame #2: 0x00000002107f4d78 libsystem_c.dylib`abort + 140
frame #3: 0x000000020febcf78 libc++abi.dylib`abort_message + 132
frame #4: 0x000000020febd120 libc++abi.dylib`default_terminate_handler() + 304
frame #5: 0x000000020fed5e48 libobjc.A.dylib`_objc_terminate() + 124
frame #6: 0x000000020fec90fc libc++abi.dylib`std::__terminate(void (*)()) + 16
frame #7: 0x000000020fec8cec libc++abi.dylib`__cxa_rethrow + 144
frame #8: 0x000000020fed5c10 libobjc.A.dylib`objc_exception_rethrow + 44
frame #9: 0x0000000210c90624 CoreFoundation`CFRunLoopRunSpecific + 544
frame #10: 0x0000000212f04584 GraphicsServices`GSEventRunModal + 100
frame #11: 0x000000023db0cbc8 UIKitCore`UIApplicationMain + 212
* frame #12: 0x00000001006b8464 ACG`main at AppDelegate.swift:13
frame #13: 0x0000000210750b94 libdyld.dylib`start + 4