Skip to content

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

@becdetat

Description

@becdetat

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions