forked from github/wulkanowy-mirror
Fix NPE when trying to remove a message from mailbox that doesn't match any student (#2090)
This commit is contained in:
parent
7efd106658
commit
83974b6550
@ -178,7 +178,7 @@ class MessageRepository @Inject constructor(
|
||||
).first()
|
||||
}
|
||||
|
||||
suspend fun deleteMessage(student: Student, mailbox: Mailbox, message: Message) {
|
||||
suspend fun deleteMessage(student: Student, mailbox: Mailbox?, message: Message) {
|
||||
deleteMessages(student, mailbox, listOf(message))
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ class MessagePreviewPresenter @Inject constructor(
|
||||
runCatching {
|
||||
val student = studentRepository.getCurrentStudent(decryptPass = true)
|
||||
val mailbox = messageRepository.getMailboxByStudent(student)
|
||||
messageRepository.deleteMessage(student, mailbox!!, message!!)
|
||||
messageRepository.deleteMessage(student, mailbox, message!!)
|
||||
}
|
||||
.onFailure {
|
||||
retryCallback = { onMessageDelete() }
|
||||
|
Loading…
x
Reference in New Issue
Block a user