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

Null input throws null ref, should go to Else clause #1

Open
becdetat opened this issue May 30, 2016 · 1 comment
Open

Null input throws null ref, should go to Else clause #1

becdetat opened this issue May 30, 2016 · 1 comment

Comments

@becdetat
Copy link
Owner

becdetat commented May 30, 2016

Passing a null in as the match value without a predicate condition matching against null currently throws a NullReferenceException inside Simplicity:

string name = null;

name.Match()
    .With("ben", "it me!")
    .Else("unknown")
    .Do()
    .Dump();

This should return "unknown".

Matching against (string)null also throws a NullReferenceException. This clause should match (string)null but it doesn't:

.With((string)null, "match on null")
@johnknoop
Copy link

Any progress on this?

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

No branches or pull requests

2 participants