Skip to content

Sometimes, Register fails with message Object reference not set to an instance of an object #3

Description

@yong2khoo88

image

As titled, sometimes the Register function just fails with the message, which, is outside the callback.
Here's my code

 public void RegisterPlayer()
    {
        Debug.Log("Registering...");
        NetworkClient.Lobby.Register(CurrentPlayerName, (successful, reply, error) => {
            if (successful)
            {
                Debug.Log($"Lobby registered roomId: {reply.roomId}, started: {reply.started}");
            }
            else
            {
                Debug.Log("Lobby failed to register " + reply);
            }
        });
    }

I expect it at least appears after "Lobby failed to register".. but it seems to totally throw the exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions