Alona Kaplan has uploaded a new change for review.

Change subject: engine: fix coverity issue- add null safety check to 
getPciDeviceNameByNic
......................................................................

engine: fix coverity issue- add null safety check to getPciDeviceNameByNic

Change-Id: I8b5a5b293279e116958f8f1828023c162b58d99d
Signed-off-by: Alona Kaplan <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/HostNicVfsConfigHelperImpl.java
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/44/39444/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/HostNicVfsConfigHelperImpl.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/HostNicVfsConfigHelperImpl.java
index 7bd48b8..65b864a 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/HostNicVfsConfigHelperImpl.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/HostNicVfsConfigHelperImpl.java
@@ -213,7 +213,13 @@
 
     @Override
     public String getPciDeviceNameByNic(VdsNetworkInterface nic) {
-        return getPciDeviceByNic(nic, 
getDevicesByHostId(nic.getVdsId())).getDeviceName();
+        HostDevice pciDevice = getPciDeviceByNic(nic, 
getDevicesByHostId(nic.getVdsId()));
+
+        if (pciDevice != null) {
+            return pciDevice.getDeviceName();
+        }
+
+        return null;
     }
 
     @Override


-- 
To view, visit https://gerrit.ovirt.org/39444
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b5a5b293279e116958f8f1828023c162b58d99d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to