[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,7 +48,9 @@ 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) {
|
||||||
backupViewModel.restoreBackup(requireActivity(), requireContext().contentResolver.openInputStream(it))
|
it?.let {
|
||||||
|
backupViewModel.restoreBackup(requireActivity(), requireContext().contentResolver.openInputStream(it))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.createBackup.setOnClickListener {
|
binding.createBackup.setOnClickListener {
|
||||||
|
|
Loading…
Reference in a new issue