[CSHARP-1932] Issue with nullable parameter Created: 06/Mar/17 Updated: 01/May/17 Resolved: 06/Mar/17 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Linq |
| Affects Version/s: | 2.4.2 |
| Fix Version/s: | 2.4.3 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Rob Offer | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
We are experiencing a null reference exception when attempting to build a filter using a nullable parameter, even though the value is not null. I have attached a sample file to illustrate the error, if you attempt to use a nullable enumeration as a Type in a LINQ filter you get a null reference exception. I'm aware the type on the serialised class (User) is not nullable, but the nullable parameter is used to distinguish whether a filter is needed or not. We have isolated this down to the upgrade between 2.4.1 and 2.4.2. |
| Comments |
| Comment by Robert Stam [ 06/Mar/17 ] | ||
|
I can reproduce this. It is essentially the same issue as A work around is to use .Value to convert the nullable value to a non-nullable value:
|