Commit 5c2cc89f by pidan

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

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