Skip to content

NullReferenceException at GoogleClient.OnSignInFailed on Android #82

@luccasclezar

Description

@luccasclezar

Sometimes OnSignInFailed throws a NullReferenceException.

Fatal Exception: NullReferenceException:  Object reference not set to an instance of an object.
       at GoogleClient.OnSignInFailed (ApiException apiException) [0x00398] in <475a18f0ab504c00b219a3927ea4557b>:0(GoogleClient.cs)
       at Plugin.GoogleClient.OnComplete (Task task) [0x000b7] in <475a18f0ab504c00b219a3927ea4557b>:0(GoogleClient.cs)

My guess is that for some reason, this line:

OnSignInFailed(task.Exception.JavaCast<ApiException>());

Fails to cast the native exception to an ApiException, throwing a NullReferenceException when OnSignInFailed tries to get the StatusCode.

Probably a null check would fix it, but I can't even try/catch this because the exception is inside a callback.

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