-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix NRE inside RemotingTerminator #4686
fix NRE inside RemotingTerminator #4686
Conversation
This patch also fixes all NRE's originating from the logging system for any FSM<TState,TData> inside Akka.NET
Applied some ReSharper-ing to cleanup the internal message processing of the FSM to take advantage of C#7/8 features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great change - definitely need to make loggers creation to be a safe operation.
Left some comments, not sure about ones which are non-refactoring though
@@ -713,8 +713,7 @@ private void InitFSM() | |||
{ | |||
When(TerminatorState.Uninitialized, @event => | |||
{ | |||
var internals = @event.FsmEvent as Internals; | |||
if (internals != null) | |||
if (@event.FsmEvent is Internals internals) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always lovely to see how new language features make old code pretty 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
close #4677
This patch also fixes all NRE's originating from the logging system for any
FSM<TState,TData
inside Akka.NET