修复了一些可能因为uid没有导致的崩溃

This commit is contained in:
fengshuo
2023-01-04 15:11:28 +08:00
parent 81d7066ecb
commit 567f371a07
5 changed files with 27 additions and 17 deletions

View File

@@ -192,10 +192,12 @@
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
XPMineFootPrintModel *model = [self.datasource safeObjectAtIndex1:indexPath.row];
if (model.roomUid.integerValue > 0) {
[XPRoomViewController openRoom:model.roomUid viewController:self];
}
if (self.datasource.count > 0) {
XPMineFootPrintModel *model = [self.datasource safeObjectAtIndex1:indexPath.row];
if (model.roomUid.integerValue > 0) {
[XPRoomViewController openRoom:model.roomUid viewController:self];
}
}
}
#pragma mark - XPFootPrintNavViewDelegate

View File

@@ -220,7 +220,9 @@
NSString *uid = userInfo.userId;
if (userInfo.volume > 2){
if (uid.integerValue == 0) {
[uids addObject:[[AccountInfoStorage instance] getUid]];
if ([AccountInfoStorage instance].getUid.length > 0){
[uids addObject:[[AccountInfoStorage instance] getUid]];
}
}else {
[uids addObject:uid];
}

View File

@@ -100,6 +100,7 @@
- (void)dealloc {
NSLog(@"销毁了");
[self resetAcrossPKViewData];
}
- (instancetype)initWithFrame:(CGRect)frame {

View File

@@ -1270,19 +1270,21 @@
self.topicStackView.hidden = ([ClientConfig shareConfig].configInfo.appStoreAuditNoticeVersion || self.delegate.getRoomInfo.type == RoomType_MiniGame) == YES;
}
[self updateRoomTopicViewConstraint];
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
request.userIds = @[[AccountInfoStorage instance].getUid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
if (error== nil) {
NIMChatroomMember* member = members.firstObject;
if (member.type == NIMChatroomMemberTypeCreator || member.type == NIMChatroomMemberTypeManager) {
self.editButton.hidden = NO;
} else {
self.editButton.hidden = YES;
if ([AccountInfoStorage instance].getUid.length > 0) {
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
request.userIds = @[[AccountInfoStorage instance].getUid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
if (error== nil) {
NIMChatroomMember* member = members.firstObject;
if (member.type == NIMChatroomMemberTypeCreator || member.type == NIMChatroomMemberTypeManager) {
self.editButton.hidden = NO;
} else {
self.editButton.hidden = YES;
}
}
}
}];
}];
}
self.topicLabel.text = self.delegate.getRoomInfo.roomDesc.length > 0 ? self.delegate.getRoomInfo.roomDesc : @"暂未设置话题";
}

View File

@@ -131,6 +131,9 @@
voice.isSelected = [RtcManager instance].isRemoteMuted;
NSString * uid = [AccountInfoStorage instance].getUid;
if (uid.length <= 0) {
return;
}
NSString * roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = roomId;