8000 Make `ToDataTable` implementation null-safer by atifaziz · Pull Request #854 · morelinq/MoreLINQ · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make ToDataTable implementation null-safer #854

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions MoreLinq/ToDataTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,8 @@ MemberInfo GetAccessedMember(LambdaExpression lambda)

// Check if the member expression is valid and is a "first level"
// member access e.g. not a.b.c
return body is MemberExpression memberExpression
&& memberExpression.Expression.NodeType == ExpressionType.Parameter
? memberExpression.Member
return body is MemberExpression { Expression.NodeType: ExpressionType.Parameter, Member: var member }
? member
: throw new ArgumentException($"Illegal expression: {lambda}", nameof(lambda));
}
}
Expand Down
0