Result intent can be null depending on the camera app, ignore it

This commit is contained in:
Naveen 2022-08-22 00:19:04 +05:30
parent bb742fa7e2
commit f965bcd37b
1 changed files with 1 additions and 1 deletions

View File

@ -201,7 +201,7 @@ class ThreadActivity : SimpleActivity() {
super.onActivityResult(requestCode, resultCode, resultData) super.onActivityResult(requestCode, resultCode, resultData)
if (resultCode != Activity.RESULT_OK) return if (resultCode != Activity.RESULT_OK) return
if (requestCode == TAKE_PHOTO_INTENT && resultData != null) { if (requestCode == TAKE_PHOTO_INTENT) {
addAttachment(capturedImageUri!!) addAttachment(capturedImageUri!!)
} else if (requestCode == PICK_ATTACHMENT_INTENT && resultData != null && resultData.data != null) { } else if (requestCode == PICK_ATTACHMENT_INTENT && resultData != null && resultData.data != null) {
addAttachment(resultData.data!!) addAttachment(resultData.data!!)