Check null of pending operations before updating status

revert-dabc3590
Saad Sahibjan 5 years ago
parent d4f0bf7a20
commit a6f0a71681

@ -582,10 +582,12 @@ public class AndroidDeviceUtils {
throws DeviceManagementException {
try {
List<? extends Operation> pendingOperations = getPendingOperations(deviceIdentifier);
if (pendingOperations != null && !pendingOperations.isEmpty()) {
for (Operation operation : pendingOperations) {
operation.setStatus(Operation.Status.ERROR);
AndroidAPIUtils.getDeviceManagementService().updateOperation(deviceIdentifier, operation);
}
}
} catch (OperationManagementException e) {
String msg = "Error occurred while retrieving pending operations to update operation statuses of " +
"device to be dis-enrolled";

Loading…
Cancel
Save