diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/SubscriptionManagementAPIImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/SubscriptionManagementAPIImpl.java index e5128e13885..5c521487de2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/SubscriptionManagementAPIImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/SubscriptionManagementAPIImpl.java @@ -45,7 +45,7 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{ @Override public Response installApplication(@ApiParam(name = "installationDetails", value = "The application ID and list" + " the devices/users/roles", required = true) @Valid InstallationDetails installationDetails) { - Object response = null; + Object response; SubscriptionManager subscriptionManager = APIUtil.getSubscriptionManager(); try { String applicationUUTD = installationDetails.getApplicationUUID(); @@ -60,6 +60,7 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{ response = subscriptionManager.installApplicationForRoles(applicationUUTD, roleList); } else { response = "Missing request data!"; + return Response.status(Response.Status.BAD_REQUEST).entity(response).build(); } return Response.status(Response.Status.OK).entity(response).build(); } catch (ApplicationManagementException e) {