[iOS] Avoid continuation misuse in Leo WebUI photo picker (#35974)
This is a speculative fix for the Photos picker calling the `didFinishPicking` delegate method more than once by ensuring that the continuation is niled out after a single use.
This commit is contained in:
@@ -197,6 +197,7 @@ extension BrowserViewController {
|
||||
var continuation: CheckedContinuation<[PHPickerResult], Never>?
|
||||
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
|
||||
continuation?.resume(returning: results)
|
||||
continuation = nil
|
||||
picker.dismiss(animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user