From 3a25572fda7b13c91997fb28b6b076c5829a4e25 Mon Sep 17 00:00:00 2001 From: hasuniea Date: Mon, 22 Aug 2016 10:51:35 +0530 Subject: [PATCH] fixing EMM-1509 issue --- .../services/impl/DeviceTypeConfigurationServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java index 0704ab188e..effbd6876e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java @@ -91,6 +91,12 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati Message responseMsg = new Message(); ConfigurationEntry licenseEntry = null; PlatformConfiguration configuration = new PlatformConfiguration(); + if (androidPlatformConfiguration == null) { + String errorMessage = "The payload of the android platform configuration is incorrect."; + log.error(errorMessage); + throw new org.wso2.carbon.mdm.services.android.exception.BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } configuration.setConfiguration(androidPlatformConfiguration.getConfiguration()); try { configuration.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);