Added null check to resolve wso2/product-iots#1367

revert-70aa11f8
Harshan Liyanage 7 years ago
parent cd0195b7e7
commit 5996e6841b

@ -350,7 +350,9 @@ public class DeviceManagementPluginRepository implements DeviceManagerStartupLis
if (deviceStatusTaskPluginConfig != null && deviceStatusTaskPluginConfig.isRequireStatusMonitoring()) { if (deviceStatusTaskPluginConfig != null && deviceStatusTaskPluginConfig.isRequireStatusMonitoring()) {
try { try {
DeviceManagementDataHolder.getInstance().removeDeviceStatusTaskPluginConfig(deviceType); DeviceManagementDataHolder.getInstance().removeDeviceStatusTaskPluginConfig(deviceType);
if (deviceStatusTaskManagerService != null) {
deviceStatusTaskManagerService.stopTask(deviceType, deviceStatusTaskPluginConfig); deviceStatusTaskManagerService.stopTask(deviceType, deviceStatusTaskPluginConfig);
}
} catch (DeviceStatusTaskException e) { } catch (DeviceStatusTaskException e) {
throw new DeviceManagementException("Error occurred while stopping Device Status task service for '" + throw new DeviceManagementException("Error occurred while stopping Device Status task service for '" +
deviceManagementService.getType() + "'", e); deviceManagementService.getType() + "'", e);

Loading…
Cancel
Save