Fix crash when entering a DM after a call is hung-up/rejected while being answered (#4403)

This commit is contained in:
langleyd
2021-06-08 13:41:37 +01:00
parent 240493d98b
commit abccc2d964
2 changed files with 7 additions and 0 deletions
@@ -412,6 +412,11 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell {
return (NSTimeIntervalSince1970 - TimeInterval(startDate))/MSEC_PER_SEC
}
guard startDate < endDate else {
// started but hung up/rejected on other end around the same time
return 0
}
// ended, compute the diff between two dates
return TimeInterval(endDate - startDate)/MSEC_PER_SEC
}