Refactor: Remove superfluous postCrashHandlingRunnable (#6974)

This commit is contained in:
Timo T 2022-05-28 00:11:14 +02:00 committed by GitHub
parent 067be5a292
commit e4e6b842cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,14 +81,12 @@ class CustomFileLocationHelperAndroid(private val activity: Activity) : CustomFi
} }
fun onActivityResult(requestCode: Int, data: Intent?) { fun onActivityResult(requestCode: Int, data: Intent?) {
val callback = synchronized(this) { val activityCallback = synchronized(this) {
val index = callbacks.indexOfFirst { it.requestCode == requestCode } val index = callbacks.indexOfFirst { it.requestCode == requestCode }
if (index == -1) return if (index == -1) return
callbacks.removeAt(index) callbacks.removeAt(index)
} }
postCrashHandlingRunnable { activityCallback.callback(data?.data)
callback.callback(data?.data)
}
} }
} }