From fc9b908799a3d517a64b6388bdfd268c2dc16981 Mon Sep 17 00:00:00 2001 From: Ivan Sekovanikj Date: Tue, 19 Nov 2024 15:45:53 +0100 Subject: [PATCH] fix: expo media library permissions race conditions --- package/expo-package/src/optionalDependencies/pickImage.ts | 2 ++ package/native-package/src/optionalDependencies/pickImage.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/package/expo-package/src/optionalDependencies/pickImage.ts b/package/expo-package/src/optionalDependencies/pickImage.ts index 9d2ce11533..fa6b98d034 100644 --- a/package/expo-package/src/optionalDependencies/pickImage.ts +++ b/package/expo-package/src/optionalDependencies/pickImage.ts @@ -53,8 +53,10 @@ export const pickImage = ImagePicker return { cancelled: true }; } } + return { cancelled: true }; } catch (error) { console.log('Error while picking image', error); + return { cancelled: true }; } } : null; diff --git a/package/native-package/src/optionalDependencies/pickImage.ts b/package/native-package/src/optionalDependencies/pickImage.ts index 574c1538e9..5ab35fcd76 100644 --- a/package/native-package/src/optionalDependencies/pickImage.ts +++ b/package/native-package/src/optionalDependencies/pickImage.ts @@ -35,6 +35,7 @@ export const pickImage = ImagePicker } } catch (error) { console.log('Error picking image: ', error); + return { cancelled: true }; } } : null;