Commit d662d32
fix: handle null expressions in GetFullPropertyPath for complex conditionals
Previously, complex conditional expressions with null values would throw:
System.ArgumentNullException: Value cannot be null. (Parameter 'expression')
This occurred when using conditional expressions like:
x.DueDate.HasValue ? (calculation) : (int?)null
The fix adds comprehensive null checking throughout GetFullPropertyPath to:
- Handle null operands in Convert/Cast expressions
- Handle null arguments in method calls, constructors, and invocations
- Handle null expressions in member access, conditionals, and binary operations
- Return appropriate string representations ("null") for null values
Changes made:
- Added null checks in Convert, MemberAccess, Binary, Conditional expressions
- Added null checks for method call arguments and objects
- Added null checks for New expression arguments and constructors
- Added null checks for Invoke expression arguments
- All null expressions now return "null" instead of throwing
Test added to verify complex conditional expressions with nullable types
no longer throw ArgumentNullException and are handled gracefully.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 2f0051a commit d662d32
File tree
2 files changed
+62
-14
lines changed- QueryKit.IntegrationTests/Tests
- QueryKit
2 files changed
+62
-14
lines changedLines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3796 | 3796 | | |
3797 | 3797 | | |
3798 | 3798 | | |
| 3799 | + | |
| 3800 | + | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
| 3814 | + | |
| 3815 | + | |
| 3816 | + | |
| 3817 | + | |
| 3818 | + | |
| 3819 | + | |
| 3820 | + | |
| 3821 | + | |
| 3822 | + | |
| 3823 | + | |
| 3824 | + | |
| 3825 | + | |
| 3826 | + | |
| 3827 | + | |
| 3828 | + | |
| 3829 | + | |
| 3830 | + | |
| 3831 | + | |
| 3832 | + | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + | |
| 3836 | + | |
| 3837 | + | |
| 3838 | + | |
| 3839 | + | |
| 3840 | + | |
| 3841 | + | |
3799 | 3842 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
202 | | - | |
203 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| |||
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
223 | | - | |
224 | | - | |
| 225 | + | |
| 226 | + | |
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
| |||
230 | 232 | | |
231 | 233 | | |
232 | 234 | | |
233 | | - | |
234 | | - | |
235 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
236 | 238 | | |
237 | 239 | | |
238 | 240 | | |
239 | 241 | | |
240 | | - | |
241 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
242 | 246 | | |
243 | 247 | | |
244 | 248 | | |
245 | | - | |
246 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
247 | 252 | | |
248 | 253 | | |
249 | 254 | | |
| |||
0 commit comments