Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# - [BUG] Calling RPC without socket causes NullReferenceException #131

Open
PrzemekAcram opened this issue May 31, 2022 · 0 comments
Open
Labels

Comments

@PrzemekAcram
Copy link

Hello,

I would like to report a bug.

Sending more than 9k characters with IClient's RpcAsync method causes NullReferenceException.

Example method which throws exception:

    async void sendLongString (Client nakamaClient, string serverKey)
{
    string longString = "buubvubqou5623vt78";

    for (int i = 0; i < 9; ++i)
    {
        longString += longString;
    }

    string messageToSend = "{\"longString\": \"" + longString + "\"}";

    var response = await nakamaClient.RpcAsync (serverKey, rpcName, messageToSend); // <- NullReferenceException.
    string result = response.Payload;

    Debug.Log ("Response: " + result);
}

There is no issue If we do the same by the socket (socket.RpcAsync (rpcName, messageToSend);. Sending request from Postman works as well.

Exception:

NullReferenceException: Object reference not set to an instance of an object
Nakama.HttpRequestAdapter+d__8.MoveNext () (at <3930c37f95f7433fa71239b42efdd1f6>:0)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <9577ac7a62ef43179789031239ba8798>:0)
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () (at <9577ac7a62ef43179789031239ba8798>:0) Nakama.ApiClient+<RpcFunc2Async>d__68.MoveNext () (at <3930c37f95f7433fa71239b42efdd1f6>:0) --- End of stack trace from previous location where exception was thrown --- Nakama.RetryInvoker+<InvokeWithRetry>d__61[T].MoveNext () (at <3930c37f95f7433fa71239b42efdd1f6>:0)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <9577ac7a62ef43179789031239ba8798>:0)
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0)
(....)

Best,
Przemek

@PrzemekAcram PrzemekAcram changed the title Calling RPC without socket causes NullReferenceException [BUG] Calling RPC without socket causes NullReferenceException May 31, 2022
@lugehorsam lugehorsam self-assigned this Jun 15, 2022
@lugehorsam lugehorsam changed the title [BUG] Calling RPC without socket causes NullReferenceException C# - [BUG] Calling RPC without socket causes NullReferenceException Sep 21, 2022
@lugehorsam lugehorsam added the C# label Sep 21, 2022
@lugehorsam lugehorsam removed their assignment Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants