From 734aaa8c9e9c94eedc69296ba05e04d3a133a8fd Mon Sep 17 00:00:00 2001 From: mharindu Date: Mon, 8 Aug 2016 19:24:57 +0530 Subject: [PATCH] Fixed null pointer exception --- .../mgt/core/permission/mgt/PermissionManagerServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java index 9dd03555a2..0cdae21617 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java @@ -62,6 +62,10 @@ public class PermissionManagerServiceImpl implements PermissionManagerService { public Permission getPermission(Properties properties) throws PermissionManagementException { String url = (String) properties.get(URL_PROPERTY); String httpMethod = (String) properties.get(HTTP_METHOD_PROPERTY); + + if (url == null || url.isEmpty() || httpMethod == null || httpMethod.isEmpty()) { + throw new PermissionManagementException("Resource URI/HTTP method is empty"); + } return permissionTree.getPermission(url, httpMethod); } }