From e12e7a3876d310393f2ca0359b09403a67684df3 Mon Sep 17 00:00:00 2001 From: charitha Date: Sun, 30 Sep 2018 21:57:29 +0530 Subject: [PATCH] Add validation to event retrial --- .../jaxrs/service/impl/DeviceEventManagementServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java index f9faa784f1f..2bbcee2d43a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java @@ -348,6 +348,10 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe String errorMessage = "Invalid values for from/to"; return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build(); } + if (limit == 0) { + String errorMessage = "Invalid values for offset/limit"; + return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build(); + } String fromDate = String.valueOf(from); String toDate = String.valueOf(to); String query = DEFAULT_META_DEVICE_ID_ATTRIBUTE + ":" + deviceId