use safe call operator

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2024-11-26 12:12:03 +01:00
parent 2da78f69f2
commit fdbff4a8e6
No known key found for this signature in database
GPG key ID: F7AA2A8B65B50220

View file

@ -176,19 +176,21 @@ class SetStatusDialogFragment :
@SuppressLint("NotifyDataSetChanged")
override fun onNext(statusOverall: StatusOverall) {
if (statusOverall.ocs?.meta?.statusCode == HTTP_STATUS_CODE_OK) {
backupStatus = statusOverall.ocs?.data!!
if (backupStatus.message != null) {
isBackupStatusAvailable = true
val backupPredefinedStatus = PredefinedStatus(
backupStatus.userId!!,
backupStatus.icon,
backupStatus.message!!,
ClearAt(type = "period", time = backupStatus.clearAt.toString())
)
binding.automaticStatus.visibility = View.VISIBLE
adapter.isBackupStatusAvailable = true
predefinedStatusesList.add(0, backupPredefinedStatus)
adapter.notifyDataSetChanged()
statusOverall.ocs?.data?.let { status ->
backupStatus = status
if (backupStatus.message != null) {
isBackupStatusAvailable = true
val backupPredefinedStatus = PredefinedStatus(
backupStatus.userId!!,
backupStatus.icon,
backupStatus.message!!,
ClearAt(type = "period", time = backupStatus.clearAt.toString())
)
binding.automaticStatus.visibility = View.VISIBLE
adapter.isBackupStatusAvailable = true
predefinedStatusesList.add(0, backupPredefinedStatus)
adapter.notifyDataSetChanged()
}
}
}
}