Yair Zaslavsky has uploaded a new change for review.

Change subject: core: Fixing possible NPE
......................................................................

core: Fixing possible NPE

Change-Id: I04c462c0d2b1d0a326c4c80f66360d036be2fbc9
Signed-off-by: Yair Zaslavsky <yzasl...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/provider/foreman/ForemanHostProviderProxy.java
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/38/37738/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/provider/foreman/ForemanHostProviderProxy.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/provider/foreman/ForemanHostProviderProxy.java
index 5c8802b..105d517 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/provider/foreman/ForemanHostProviderProxy.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/provider/foreman/ForemanHostProviderProxy.java
@@ -9,6 +9,7 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.codehaus.jackson.map.DeserializationConfig.Feature;
 import org.codehaus.jackson.map.ObjectMapper;
@@ -316,7 +317,7 @@
         final List<ContentHost> contentHosts =
                 runContentHostListMethod(CONTENT_HOSTS_ENTRY_POINT + 
String.format(SEARCH_QUERY_FORMAT, hostNameFact));
 
-        if (contentHosts.isEmpty()) {
+        if (CollectionUtils.isEmpty(contentHosts)) {
             log.error("Failed to find host on provider by host name '{}' ", 
host.getHostName());
             return null;
         }


-- 
To view, visit http://gerrit.ovirt.org/37738
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I04c462c0d2b1d0a326c4c80f66360d036be2fbc9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to