From d1a98f2a6ef191af251942bcaa19d4d36b891118 Mon Sep 17 00:00:00 2001 From: Ruben Nine Date: Mon, 20 Sep 2021 12:36:28 +0200 Subject: [PATCH] Ensuring `completionBlock` is called in all paths. --- .../UI/Internal/Controllers/ImagePickerUploadController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Filestack/UI/Internal/Controllers/ImagePickerUploadController.swift b/Sources/Filestack/UI/Internal/Controllers/ImagePickerUploadController.swift index a0fb736b..07906422 100644 --- a/Sources/Filestack/UI/Internal/Controllers/ImagePickerUploadController.swift +++ b/Sources/Filestack/UI/Internal/Controllers/ImagePickerUploadController.swift @@ -202,12 +202,13 @@ private extension ImagePickerUploadController { group.wait() - self.completionBlock?(urls) self.upload(urls: urls) } } func upload(urls: [URL]) { + completionBlock?(urls) + guard let uploader = uploader else { return } trackingProgress.update(tracked: uploader.progress, delay: 1)