mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
fixed null pointer in the initial operations
This commit is contained in:
parent
483d09ebf1
commit
cb9db4dd1d
@ -2114,22 +2114,25 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
||||
deviceIdentifiers.add(deviceIdentifier);
|
||||
if (init != null) {
|
||||
List<String> initialOperations = init.getOperations();
|
||||
|
||||
for (String str : initialOperations) {
|
||||
CommandOperation operation = new CommandOperation();
|
||||
operation.setEnabled(true);
|
||||
operation.setType(Operation.Type.COMMAND);
|
||||
operation.setCode(str);
|
||||
try {
|
||||
deviceManagementProviderService.
|
||||
addOperation(deviceType,
|
||||
operation, deviceIdentifiers);
|
||||
} catch (OperationManagementException e) {
|
||||
throw new DeviceManagementException("Unable to find the device with the id: '" + deviceIdentifier.getId(),
|
||||
e);
|
||||
} catch (InvalidDeviceException e) {
|
||||
throw new DeviceManagementException("Unable to find the device with the id: '" + deviceIdentifier.getId(),
|
||||
e);
|
||||
if (initialOperations != null) {
|
||||
for (String str : initialOperations) {
|
||||
CommandOperation operation = new CommandOperation();
|
||||
operation.setEnabled(true);
|
||||
operation.setType(Operation.Type.COMMAND);
|
||||
operation.setCode(str);
|
||||
try {
|
||||
deviceManagementProviderService.
|
||||
addOperation(deviceType,
|
||||
operation, deviceIdentifiers);
|
||||
} catch (OperationManagementException e) {
|
||||
throw new DeviceManagementException(
|
||||
"Unable to find the device with the id: '" + deviceIdentifier.getId(),
|
||||
e);
|
||||
} catch (InvalidDeviceException e) {
|
||||
throw new DeviceManagementException(
|
||||
"Unable to find the device with the id: '" + deviceIdentifier.getId(),
|
||||
e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user