Description
Hi, I'm trying out the Firebase flow in a test app and I'm running into this error, calling "fetchSignInMethodsForEmail" when providing an email that hasn't registered with my app.
Expected behavior: fetchSignInMethodsForEmail should resolve to an empty array when the SDK method returns null.
Actual behavior: app crashes with "TypeError: Cannot read property 'enumerateObjectsUsingBlock' of null."
Here's the method in question (line 911): https://github.com/NativeScript/firebase/blob/main/packages/firebase-auth/index.ios.ts#:~:text=fetchSignInMethodsForEmail
A quick check for truthiness or an explicit null check should be sufficient:
this.native.fetchSignInMethodsForEmailCompletion(email, (emails, error) => { if (error) { reject(FirebaseError.fromNative(error)); } else { const arr = []; if (emails) { emails.enumerateObjectsUsingBlock((email) => { arr.push(email); }); } resolve(arr); } });