Skip to content

Commit

Permalink
UUID crash fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kristofnemere committed Jan 27, 2023
1 parent f53de62 commit 7a73191
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,10 @@ class SpeedGraderCommentsPresenter(

private fun subscribePendingWorkers() {
subscribeJob = weave {
val pendingComments = pendingSubmissionCommentDao.findByPageId(mPageId).orEmpty()
viewCallback?.subscribePendingWorkers(pendingComments.mapNotNull { UUID.fromString( it.pendingSubmissionCommentEntity.workerId) })
val workerIds = pendingSubmissionCommentDao.findByPageId(mPageId).orEmpty()
.filter { it.pendingSubmissionCommentEntity.workerId != null && it.pendingSubmissionCommentEntity.workerId != "null" }
.mapNotNull { UUID.fromString(it.pendingSubmissionCommentEntity.workerId) }
viewCallback?.subscribePendingWorkers(workerIds)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ data class PendingSubmissionCommentWithFileUploadInput(
date = pendingSubmissionCommentEntity.date
id = pendingSubmissionCommentEntity.id
status = CommentSendStatus.valueOf(pendingSubmissionCommentEntity.status)
workerId = UUID.fromString(pendingSubmissionCommentEntity.workerId)
workerId = if (pendingSubmissionCommentEntity.workerId != null && pendingSubmissionCommentEntity.workerId != "null") {
UUID.fromString(pendingSubmissionCommentEntity.workerId)
} else {
null
}
workerInputData = FileUploadWorkerData(
fileUploadInput?.filePaths ?: emptyList(),
fileUploadInput?.courseId ?: -1L,
Expand Down

0 comments on commit 7a73191

Please sign in to comment.