Fix NPE crash when duplicating tasks

This commit is contained in:
Naveen 2022-07-21 15:09:25 +05:30
parent b6afd0998d
commit 607c02dfa9
1 changed files with 1 additions and 0 deletions

View File

@ -659,6 +659,7 @@ fun Context.getDatesWeekDateTime(date: DateTime): String {
}
fun Context.isTaskCompleted(event: Event): Boolean {
if (event.id == null) return false
val task = completedTasksDB.getTaskWithIdAndTs(event.id!!, event.startTS) ?: return false
return task.flags and FLAG_TASK_COMPLETED != 0
}