Commit 1c1a42c4 authored by Geoffrey Métais's avatar Geoffrey Métais

Prevent NPE when removable storage is not found

(cherry picked from commit 13a123e6)
parent 1f518958
......@@ -92,7 +92,7 @@ class WriteExternalDelegate : BaseHeadlessFragment() {
if (activity === null) return
val fragment = WriteExternalDelegate()
callback = cb
storage = FileUtils.getMediaStorage(uri)
storage = FileUtils.getMediaStorage(uri) ?: return
fragment.arguments = Bundle(1).apply { putString(KEY_STORAGE_PATH, storage) }
activity.supportFragmentManager.beginTransaction().add(fragment, TAG).commitAllowingStateLoss()
}
......
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