Request -- Null Owner fix - #1161
Merged
Merged
Conversation
Contributor
|
👍 |
Contributor
|
The problem was that there were |
Contributor
|
The owners field itself is an optional. I can double check this to be sure, but as far as I know that should come through as an Optional.absent (meaning we are already handling it) if the owners field as a whole is null. If that is not the case though please update us here @Calvinp |
| checkBadRequest(request.getRequestType() != null, "RequestType cannot be null or missing"); | ||
|
|
||
| if (request.getOwners().isPresent()) { | ||
| checkBadRequest(!request.getOwners().get().contains(null), "Request owner(s) must not be null"); |
Contributor
There was a problem hiding this comment.
wording here is a little vague (i.e. owners: null is actually valid, but the message makes it sound like it wouldn't be) -- perhaps something like "Request owners cannot contain null values" ?
Contributor
Author
There was a problem hiding this comment.
Good point, I'll change that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR prevents new requests from being created which have one or more null owners, which have been causing errors elsewhere in Singularity.
(Dupe of #1160 for master at ssalinas' request)
/cc @ssalinas @Calvinp @tpetr