Unhandled exception. System.NullReferenceException
See original GitHub issueI use the library, an error occurs only on Linux machines
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at RJCP.IO.Ports.Native.SerialBuffer.RJCP.IO.Ports.Native.ISerialBufferStreamData.get_BytesToRead() at RJCP.IO.Ports.SerialPortStream.HandleEvent(Object state) at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi) at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action
1 callback, TState& state)`
Which leads to the failure of my program.
- This error does not occur often when the device is reconnected (physically).
- When it opens often, the port closes.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How can I fix the error: System.NullReferenceException
A NullReferenceException exception is thrown when you try to access a member on a type whose value is null. A NullReferenceException exception ...
Read more >c# - What is a NullReferenceException, and how do I fix it?
The runtime throwing a NullReferenceException always means the same thing: you are trying to use a reference, and the reference is not ......
Read more >Object Reference Not Set to an Instance of an Object
This exception is thrown when you try to access a member—for instance, a method or a property—on a variable that currently holds a...
Read more >What is NullReferenceException in C#? - Code Maze
In C#, a NullReferenceException occurs when we try to access a variable whose value has not been set or has been set to...
Read more >Debugging System.NullReferenceException - elmah.io Blog
The exception happens when you try to invoke a reference that you were expecting to point to an object but in fact, points...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I analysed the code again, and the problem should not occur with 2.4.0. The callback for the handling of events has now a try/catch block (which would cause .NET Core program to exit, instead of causing an exception).
I’ll leave this ticket open for a few days, otherwise I’ll close it as fixed in 2.4.0 which is now a NuGet package for a month or so.
@ilrom Does 2.4.0 fix your issue?