Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

NullReferenceException when logging as Trace and an argument is null #1005

Closed
moozzyk opened this issue Oct 10, 2017 · 3 comments
Closed

NullReferenceException when logging as Trace and an argument is null #1005

moozzyk opened this issue Oct 10, 2017 · 3 comments

Comments

@moozzyk
Copy link
Contributor

moozzyk commented Oct 10, 2017

System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Object.GetType()
   at Microsoft.AspNetCore.SignalR.Client.Internal.SignalRClientLoggerExtensions.<>c.<IssueInvocation>b__33_0(Object a)
   at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext()
   at System.String.Join(String separator, IEnumerable`1 values)
   at Microsoft.AspNetCore.SignalR.Client.Internal.SignalRClientLoggerExtensions.IssueInvocation(ILogger logger, String invocationId, String returnType, String methodName, Object[] args)
   at Microsoft.AspNetCore.SignalR.Client.HubConnection.InvokeCore(String methodName, InvocationRequest irq, Object[] args, Boolean nonBlocking)
   at Microsoft.AspNetCore.SignalR.Client.HubConnection.SendAsyncCore(String methodName, Object[] args, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.SignalR.Client.HubConnection.<SendAsync>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ChatClient.ChatClient.<SendMessage>d__6.MoveNext() in C:\source\SignalR-Samples\ChatSample\ChatClient\ChatClient.cs:line 56

here.

@moozzyk moozzyk changed the title NullReferenceException when logging NullReferenceException when logging as Trace and an argument is null Oct 10, 2017
@BrennanConroy
Copy link
Member

Nice, so we should probably handle null arguments

@moozzyk
Copy link
Contributor Author

moozzyk commented Oct 10, 2017

Yes. I did not notice but when I pressed Ctrl+C Console.ReadLine() returned null which I tried to send and got the exception. I think we should review logging since I think I saw the same pattern in at least one more place.

moozzyk pushed a commit that referenced this issue Oct 25, 2017
Storing exception thrown during parameter binding and rethrowing when the method is about to throw. This allows completing invocations with a HubException and keeping the connection open.
We will also no longer close the connection if parameters for client side methods cannot be bound. We will log and continue.

Fixes: #818

(Also fixing #1005 because I was just touching this line)
moozzyk pushed a commit that referenced this issue Oct 25, 2017
Storing exception thrown during parameter binding and rethrowing when the method is about to throw. This allows completing invocations with a HubException and keeping the connection open.
We will also no longer close the connection if parameters for client side methods cannot be bound. We will log and continue.

Fixes: #818

(Also fixing #1005 because I was just touching this line)
moozzyk added a commit that referenced this issue Oct 30, 2017
Late parameter binding

Storing exception thrown during parameter binding and rethrowing when the method is about to throw. This allows completing invocations with a HubException and keeping the connection open.
We will also no longer close the connection if parameters for client side methods cannot be bound. We will log and continue.

Fixes: #818

(Also fixing #1005 because I was just touching this line)
@moozzyk
Copy link
Contributor Author

moozzyk commented Oct 30, 2017

Fixed in 18f770e

@moozzyk moozzyk closed this as completed Oct 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants