Fix for exceptions seen in FlowProgrammer NB, when get/put is done for invalid flow
[controller.git] / opendaylight / northbound / flowprogrammer / src / main / java / org / opendaylight / controller / flowprogrammer / northbound / FlowProgrammerNorthbound.java
index 2d270b44f98e23d65c0f03bddab1f913aabda7d5..7bd36a3cbf5b7cebde6665f23987a28a048b6d9c 100644 (file)
@@ -425,6 +425,10 @@ public class FlowProgrammerNorthbound {
                     "User is not authorized to perform this operation on container "
                             + containerName);
         }
+        if (flowConfig.getValue().getNode() == null) {
+            return Response.status(Response.Status.BAD_REQUEST).entity("Invalid Configuration. Node is null or empty")
+                    .build();
+        }
         handleResourceCongruence(name, flowConfig.getValue().getName());
         handleResourceCongruence(nodeId, flowConfig.getValue().getNode().getNodeIDString());
         handleDefaultDisabled(containerName);