Commit ef76292a authored by Geoffrey Métais's avatar Geoffrey Métais

Write permission dialog: sanity check

parent 80618c50
......@@ -36,6 +36,7 @@ class WriteExternalDelegate : BaseHeadlessFragment() {
builder.setMessage(R.string.sdcard_permission_dialog_message)
.setTitle(R.string.sdcard_permission_dialog_title)
.setPositiveButton(R.string.ok) { _, _ ->
if (!isAdded || isDetached) return@setPositiveButton
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE)
storage = arguments?.getString(KEY_STORAGE_PATH)?.apply { intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, Uri.parse(this)) }
startActivityForResult(intent, REQUEST_CODE_STORAGE_ACCESS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment