From 1efc76b6e1ddd974eb208a558605f39231155e90 Mon Sep 17 00:00:00 2001 From: Gimhan-minion Date: Thu, 4 Jan 2024 11:50:47 +0530 Subject: [PATCH] Fix test faliure by removing location null exception --- .../device/details/mgt/impl/DeviceInformationManagerImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java index c048bd4422..d3681a43c4 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java @@ -442,8 +442,8 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager { if (deviceLocation != null) { deviceDetailsDAO.deleteDeviceLocation(device.getId(), device.getEnrolmentInfo().getId()); } else { - log.error("Device location not found for device: " + device.getId()); - throw new DeviceDetailsMgtException("Device location not found for device: " + device.getId()); + log.warn("Unable to find location for device with ID " + device.getId() + ". Location deletion request cannot be processed."); + return; } DeviceManagementDAOFactory.commitTransaction(); } catch (TransactionManagementException e) {