From 7b010f045d155c8fd33203c71815bcdbd61d88a3 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Wed, 26 Feb 2020 17:05:00 +0530 Subject: [PATCH] Prevent null pointer for device info --- .../core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java index 731c74b2e1c..6404051c1c3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java @@ -124,7 +124,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO { Connection conn; PreparedStatement stmt = null; ResultSet rs = null; - DeviceInfo deviceInfo = null; + DeviceInfo deviceInfo = new DeviceInfo(); try { conn = this.getConnection(); @@ -135,7 +135,6 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO { rs = stmt.executeQuery(); if (rs.next()) { - deviceInfo = new DeviceInfo(); // deviceInfo.setIMEI(rs.getString("IMEI")); // deviceInfo.setIMSI(rs.getString("IMSI")); deviceInfo.setDeviceModel(rs.getString("DEVICE_MODEL"));