NIFI-7702 This closes #4447. validate requestentity not null

Signed-off-by: Joe Witt <joewitt@apache.org>
This commit is contained in:
shreeju 2020-08-04 19:39:21 +05:30 committed by Joe Witt
parent 0861b2f632
commit 24d4ad348a
No known key found for this signature in database
GPG Key ID: 9093BF854F811A1A
2 changed files with 9 additions and 1 deletions

View File

@ -464,7 +464,7 @@ public class ControllerServiceResource extends ApplicationResource {
required = true
) final UpdateControllerServiceReferenceRequestEntity requestUpdateReferenceRequest) {
if (requestUpdateReferenceRequest.getId() == null) {
if (requestUpdateReferenceRequest == null || requestUpdateReferenceRequest.getId() == null) {
throw new IllegalArgumentException("The controller service identifier must be specified.");
}

View File

@ -283,6 +283,10 @@ public class VersionsResource extends FlowUpdateResource<VersionControlInformati
public Response updateVersionControlRequest(@ApiParam("The request ID.") @PathParam("id") final String requestId,
@ApiParam(value = "The version control component mapping.", required = true) final VersionControlComponentMappingEntity requestEntity) {
if (requestEntity == null) {
throw new IllegalArgumentException("Version control information must be specified.");
}
// Verify request
final RevisionDTO revisionDto = requestEntity.getProcessGroupRevision();
if (revisionDto == null) {
@ -790,6 +794,10 @@ public class VersionsResource extends FlowUpdateResource<VersionControlInformati
public Response updateFlowVersion(@ApiParam("The process group id.") @PathParam("id") final String groupId,
@ApiParam(value = "The controller service configuration details.", required = true) final VersionedFlowSnapshotEntity requestEntity) {
if (requestEntity == null) {
throw new IllegalArgumentException("Version control information must be specified.");
}
// Verify the request
final RevisionDTO revisionDto = requestEntity.getProcessGroupRevision();
if (revisionDto == null) {