Skip to content

onActivityResult crashing when intent is null because promise is null #426

@Shervanator

Description

@Shervanator

Issue

This is related to the fix here: #352 and the initial issue here: #130

When onActivityResult is called (e.g. when returning to app from another app) the intent can be null. This triggers the following flow:

if (data == null) {
promise.reject("Failed to authenticate", "Data intent is null" );
return;
}

Which try's to do the following:

promise.reject("Failed to authenticate", "Data intent is null" );

However if none of the other exported functions in this module are called then the promise instance variable is null. Because the promise is only set when the other functions are called. e.g.

I think we should check if the promise is set before calling it in the onActivityResult function?

cc @AlgirdasVZ @kadikraman

I'm going to play around with a fix since this is effecting us in a production app at the moment!


Environment

  • Your Identity Provider: *
  • Platform that you're experiencing the issue on: Android
  • Are you using Expo?: no
  • Package version?: 5.0.0-rc3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions