mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-14 13:08:56 +01:00
Show error toast if empty URI is passed when trying to create/restore a backup
This commit is contained in:
@@ -21,7 +21,7 @@ abstract class AbstractBackupManager(protected val context: Context) {
|
||||
internal val trackManager: TrackManager by injectLazy()
|
||||
protected val preferences: PreferencesHelper by injectLazy()
|
||||
|
||||
abstract fun createBackup(uri: Uri, flags: Int, isJob: Boolean): String?
|
||||
abstract fun createBackup(uri: Uri, flags: Int, isJob: Boolean): String
|
||||
|
||||
/**
|
||||
* Returns manga
|
||||
|
||||
@@ -44,7 +44,7 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
|
||||
* @param uri path of Uri
|
||||
* @param isJob backup called from job
|
||||
*/
|
||||
override fun createBackup(uri: Uri, flags: Int, isJob: Boolean): String? {
|
||||
override fun createBackup(uri: Uri, flags: Int, isJob: Boolean): String {
|
||||
// Create root object
|
||||
var backup: Backup? = null
|
||||
|
||||
@@ -87,7 +87,7 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
|
||||
file.openOutputStream().sink().gzip().buffer().use { it.write(byteArray) }
|
||||
val fileUri = file.uri
|
||||
|
||||
// Validate it to make sure it works
|
||||
// Make sure it's a valid backup file
|
||||
FullBackupRestoreValidator().validate(context, fileUri)
|
||||
|
||||
return fileUri.toString()
|
||||
|
||||
Reference in New Issue
Block a user