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

Ensure Arguments are never null #3770

Merged
merged 1 commit into from Apr 30, 2019
Merged

Ensure Arguments are never null #3770

merged 1 commit into from Apr 30, 2019

Conversation

ghost
Copy link

@ghost ghost commented Apr 30, 2019

While running some unit tests using a PersistentActor a NullReferenceException was encountered. The culprit seems to be that when producer.Produce() throws an exception, the creation of the TypeLoadException throws a NullReferenceException when Arguments is null. The relevant excerpt from Props lines 568-577

        public virtual ActorBase NewActor()
        {
            var type = Type;
            var arguments = Arguments;
            try {
                return producer.Produce();
            } catch (Exception e) {
                throw new TypeLoadException($"Error while creating actor instance of type {type} with {arguments.Length} args: ({StringFormat.SafeJoin(",", arguments)})", e);
            }
        }

This fix ensures that no matter how the Props is constructed, Arguments will not be null fixing the above issue. This problem might be related to issue #2026.

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb
Copy link
Member

Test failure was unrelated - re-running it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant