Commit 5c2cc89f by pidan

修复如果后台没传私享房信息,swift会崩溃的问题

parent eed26852
......@@ -107,7 +107,7 @@
@property (nonatomic, strong) FUSLiveThemeModel *theme;
/// 私享房信息
@property (nonatomic, strong) FUSRoomEncryptionData *encryptionData;
@property (nonatomic, strong) FUSRoomEncryptionData *__nullable encryptionData;
@property (nonatomic, copy) NSArray<NSString *> *reminderKeys;
......
......@@ -228,7 +228,7 @@ var isShowShareToolSheetView = true
if FUSLiveHelper.shareInstance().roomScopeType == .password {
self.passwordLabel.isHidden = false
self.passwordDescLabel.isHidden = false
self.passwordLabel.text = FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData.password
self.passwordLabel.text = FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData?.password ?? ""
} else {
self.passwordLabel.isHidden = true
self.passwordDescLabel.isHidden = true
......
......@@ -112,7 +112,7 @@ import RxSwift
let tipLabel = UILabel()
tipLabel.font = .fus_themeFont(13)
tipLabel.textColor = .fus_textColorLight2()
tipLabel.text = FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData.passwordShow
tipLabel.text = FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData?.passwordShow ?? ""
contentView.addSubview(tipLabel)
tipLabel.snp.makeConstraints { make in
make.top.equalTo(self.passwordView.snp.bottom).offset(33)
......
......@@ -116,7 +116,7 @@ import FUSCommon
for (index, iconStr) in iconImagesList.enumerated() {
var canSelect = true
if index == 0 {
if FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData.liveScopeOpen.intValue == -1 {
if FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData?.liveScopeOpen.intValue == -1 {
canSelect = false
}
}
......@@ -183,7 +183,7 @@ import FUSCommon
switch index{
case 0:
if FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData.liveScopeOpen.intValue == -1 {
if FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData?.liveScopeOpen.intValue == -1 {
self.scopeType = .password
} else {
self.scopeType = .open
......@@ -350,7 +350,7 @@ class FUSLiveStartSetPrivacyItemView: UIView {
cantSelectTipLabel.numberOfLines = 0
bgTapBtn.addSubview(cantSelectTipLabel)
cantSelectTipLabel.isHidden = true
cantSelectTipLabel.text = FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData.liveScopeOpenShow
cantSelectTipLabel.text = FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData?.liveScopeOpenShow ?? ""
cantSelectTipLabel.snp.makeConstraints { make in
make.right.equalToSuperview().inset(12)
make.centerY.equalToSuperview()
......
......@@ -204,7 +204,7 @@ import FUSCommon
if succeed {
model.scopeType = scopeType
model.password = password
FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData.password = password
FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData?.password = password
self?.startLiveModel.accept(model)
}
})
......@@ -229,7 +229,7 @@ import FUSCommon
FUSLiveStartSetPasswordView.fus_create(clickHandler: { [weak self] succeed, password in
if succeed {
model.password = password
FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData.password = password
FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData?.password = password
self?.startLiveModel.accept(model)
}
})
......
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 sign in to comment