From b33c5a312fc57a26450091ab86a809c6e747d32c Mon Sep 17 00:00:00 2001 From: Pahansith Date: Wed, 30 Sep 2020 19:42:00 +0530 Subject: [PATCH] Fix geofence creation validation --- .../mgt/jaxrs/service/impl/util/RequestValidationUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/RequestValidationUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/RequestValidationUtil.java index 0c2157cb533..99b753493c0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/RequestValidationUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/RequestValidationUtil.java @@ -533,7 +533,7 @@ public class RequestValidationUtil { throw new InputValidationException( new ErrorResponse.ErrorResponseBuilder().setCode(HttpStatus.SC_BAD_REQUEST).setMessage(msg).build()); } - if (!geofenceWrapper.getGeoJson().trim().isEmpty()) { + if (geofenceWrapper.getGeoJson() != null && !geofenceWrapper.getGeoJson().trim().isEmpty()) { isGeoJsonExists = true; } if ((geofenceWrapper.getLatitude() < -90 || geofenceWrapper.getLatitude() > 90) && !isGeoJsonExists) {