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

NullReferenceException inside BuildStringContainsPredicate #38

Closed
nino-s opened this issue Dec 6, 2018 · 6 comments
Closed

NullReferenceException inside BuildStringContainsPredicate #38

nino-s opened this issue Dec 6, 2018 · 6 comments

Comments

@nino-s
Copy link
Contributor

nino-s commented Dec 6, 2018

https://github.com/AlexanderKrutov/DataTables.Queryable/blob/master/DataTables.Queryable/QueryableExtensions.cs#L349

If the option caseInsensitive is set for columns, you do a ToLower call on the object string. If the object is null, both expressions which are build up on line 354 and 355 will call ToLower first. So you get a NullPointer before you check for not null.

@nino-s
Copy link
Contributor Author

nino-s commented Dec 11, 2018

@AlexanderKrutov can you confirm this issue?

@AlexanderKrutov
Copy link
Owner

@nino-s Thank you for contributing! Sorry for late response. Your fix will be included in the nearest release.

@VictorioBerra
Copy link
Contributor

@nino-s what DMBS are you using? SQL Server 2008-2017?

@nino-s
Copy link
Contributor Author

nino-s commented Dec 17, 2018

@VictorioBerra sry for the late response. Correct SQL Server 2017.

@VictorioBerra
Copy link
Contributor

@nino-s IIRC, SQL Server by default all queries are case insensitive.

Note, this does not mean we should not fix the bug, I just wanted to point out that you should not have to set that option for columns if you are using SQL Server 2017.

@nino-s
Copy link
Contributor Author

nino-s commented Dec 19, 2018

Alright, thx for mentioning that :)

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

3 participants