diff --git a/CHANGES.rst b/CHANGES.rst index 2500123b52..4a1ba037e4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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 * diff --git a/Riot/Modules/Room/Views/BubbleCells/Call/Direct/RoomDirectCallStatusBubbleCell.swift b/Riot/Modules/Room/Views/BubbleCells/Call/Direct/RoomDirectCallStatusBubbleCell.swift index a3dbb63dce..6e6a1c42b7 100644 --- a/Riot/Modules/Room/Views/BubbleCells/Call/Direct/RoomDirectCallStatusBubbleCell.swift +++ b/Riot/Modules/Room/Views/BubbleCells/Call/Direct/RoomDirectCallStatusBubbleCell.swift @@ -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 }