Fix overflow issue

This commit is contained in:
ismailgulek 2021-03-19 02:52:52 +03:00
parent 0bfac2533e
commit ec683c266c
No known key found for this signature in database
GPG key ID: E96336D42D9470A9

View file

@ -299,7 +299,7 @@ class RoomGroupCallStatusBubbleCell: RoomBaseCallBubbleCell {
} }
// ended, compute the diff between two dates // ended, compute the diff between two dates
return TimeInterval(endDate - startDate)/MSEC_PER_SEC return TimeInterval(max(0, Double(endDate) - Double(startDate)))/MSEC_PER_SEC
} }
private func readableCallDuration(from startEvent: MXEvent?, endEvent: MXEvent?) -> String { private func readableCallDuration(from startEvent: MXEvent?, endEvent: MXEvent?) -> String {