Skip to content

Commit

Permalink
Merge pull request #4405 from vector-im/element_4403
Browse files Browse the repository at this point in the history
Fix crash when entering a DM after a call is hung-up/rejected while being answered (#4403)
  • Loading branch information
langleyd authored Jun 9, 2021
2 parents 3679404 + 21a80b5 commit 5060d46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Changes to be released in next version
* Integrated FLEX for debug builds.

🐛 Bugfix
*
* 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 5060d46

Please sign in to comment.