Skip to content

Commit

Permalink
Fix crash when entering a DM after a call is hung-up/rejected while b…
Browse files Browse the repository at this point in the history
…eing answered (#4403)
  • Loading branch information
langleyd committed Jun 8, 2021
1 parent 688191b commit 86a9f4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Changes to be released in next version
🐛 Bugfix
* SettingsViewController: Fix crash when changing the app language (#4377).
* UserSessionsService: Fix room lists lost after a reset cache (#4395).
* UserSessionsService: Fix room lists lost after a reset cache (#4395).
* RoomDirectCallStatusBubbleCell: Fix crash when entering a DM after a call is hung-up/rejected while being answered (#4403).

⚠️ API Changes
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 86a9f4f

Please sign in to comment.