Discard backup file if it fails to be created properly (e.g. fails validation)
Cette révision appartient à :
Parent
d5015d37e1
révision
76d2c676fd
1 fichiers modifiés avec 3 ajouts et 1 suppressions
|
@ -59,8 +59,9 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
|
|||
)
|
||||
}
|
||||
|
||||
var file: UniFile? = null
|
||||
try {
|
||||
val file: UniFile = (
|
||||
file = (
|
||||
if (isJob) {
|
||||
// Get dir of file and create
|
||||
var dir = UniFile.fromUri(context, uri)
|
||||
|
@ -93,6 +94,7 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
|
|||
return fileUri.toString()
|
||||
} catch (e: Exception) {
|
||||
logcat(LogPriority.ERROR, e)
|
||||
file?.delete()
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
|
Référencer dans un nouveau ticket