mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Prevent crash when parsing a legacy call recording
This commit is contained in:
parent
48fd2ba1f8
commit
00d14feded
1 changed files with 10 additions and 4 deletions
|
|
@ -66,10 +66,16 @@ class RecordingModel @WorkerThread constructor(
|
|||
}
|
||||
|
||||
val parsedDate = fileName.split("_")[1]
|
||||
val date = SimpleDateFormat("dd-MM-yyyy-HH-mm-ss", Locale.getDefault()).parse(
|
||||
parsedDate
|
||||
)
|
||||
timestamp = date?.time ?: 0L
|
||||
var parsedTimestamp = 0L
|
||||
try {
|
||||
val date = SimpleDateFormat("dd-MM-yyyy-HH-mm-ss", Locale.getDefault()).parse(
|
||||
parsedDate
|
||||
)
|
||||
parsedTimestamp = date?.time ?: 0L
|
||||
} catch (e: Exception) {
|
||||
Log.e("$TAG Failed to parse legacy timestamp [$parsedDate]")
|
||||
}
|
||||
timestamp = parsedTimestamp
|
||||
} else {
|
||||
val withoutHeader = fileName.substring(LinphoneUtils.RECORDING_FILE_NAME_HEADER.length)
|
||||
val indexOfSeparator = withoutHeader.indexOf(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue