diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt index c6ddb1bdc5..ed7936ec85 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt @@ -203,7 +203,7 @@ class SettingsBackupController : SettingsController() { } CODE_BACKUP_RESTORE -> { uri?.path?.let { - val fileName = DocumentFile.fromSingleUri(activity, uri)!!.name!! + val fileName = DocumentFile.fromSingleUri(activity, uri)?.name ?: uri.toString() when { fileName.endsWith(".proto.gz") -> { val options = arrayOf(