You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2020/08/04 16:49:18 UTC

[nifi] branch main updated: NIFI-7702 This closes #4447. validate requestentity not null

This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 24d4ad3  NIFI-7702 This closes #4447. validate requestentity not null
24d4ad3 is described below

commit 24d4ad348a251da88ffeffb2cc21640cd9c868cc
Author: shreeju <je...@gmail.com>
AuthorDate: Tue Aug 4 19:39:21 2020 +0530

    NIFI-7702 This closes #4447. validate requestentity not null
    
    Signed-off-by: Joe Witt <jo...@apache.org>
---
 .../java/org/apache/nifi/web/api/ControllerServiceResource.java   | 2 +-
 .../src/main/java/org/apache/nifi/web/api/VersionsResource.java   | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java
index 2cd9299..c7b5e07 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java
@@ -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.");
         }
 
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/VersionsResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/VersionsResource.java
index 9b563ee..950fbaf 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/VersionsResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/VersionsResource.java
@@ -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) {