Fixing ArgumentNullException on empty select/expand - #621
Conversation
| @@ -82,33 +82,19 @@ internal SelectExpandQueryOption( | |||
|
|
|||
| // This constructor is intended for unit testing only. | |||
| internal SelectExpandQueryOption(string select, string expand, ODataQueryContext context) | |||
There was a problem hiding this comment.
Combined the testing and production constructors. The production constructor was never tested and the logic was not exactly the same.
|
I don't think the URLs that this allows are "legal" according to the ABNF (search for "$select"). I could be misreading it, or maybe something else you're aware of in the standard overrides it? |
|
What should the behavior be? Return a 400? An internal server error should still be a bug IMO |
|
Good point Giuliano, we triaged this today. |
5358306 to
f3443d8
Compare
|
@corranrogue9 Fixed |
|
|
||
| private static void ValidateNotEmptyOrWhitespace(string rawValue) | ||
| { | ||
| if (rawValue != null && string.IsNullOrWhiteSpace(rawValue)) |
There was a problem hiding this comment.
I'm actually pretty baffled that there's no existing string.IsWhiteSpace method. To double check, though, that's what you're trying to do here, right?
Any consideration for removing rawValue != null since that's already checked by both callers?

Fixes #620