[Backup] Added null check for Restore backup uri
This commit is contained in:
parent
eaa8cc3052
commit
0723c34ec4
1 changed files with 3 additions and 1 deletions
|
@ -48,9 +48,11 @@ class BackupFragment : Fragment(R.layout.fragment_backup), BackupAdapter.BackupC
|
||||||
backupViewModel.loadBackups()
|
backupViewModel.loadBackups()
|
||||||
val openFilePicker = registerForActivityResult(ActivityResultContracts.OpenDocument()) {
|
val openFilePicker = registerForActivityResult(ActivityResultContracts.OpenDocument()) {
|
||||||
lifecycleScope.launch(Dispatchers.IO) {
|
lifecycleScope.launch(Dispatchers.IO) {
|
||||||
|
it?.let {
|
||||||
backupViewModel.restoreBackup(requireActivity(), requireContext().contentResolver.openInputStream(it))
|
backupViewModel.restoreBackup(requireActivity(), requireContext().contentResolver.openInputStream(it))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
binding.createBackup.setOnClickListener {
|
binding.createBackup.setOnClickListener {
|
||||||
showCreateBackupDialog()
|
showCreateBackupDialog()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue