mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-04 20:29:27 +01:00
fix NPE
This commit is contained in:
parent
b66b3f1c45
commit
592807c036
@ -268,7 +268,7 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
|
|||||||
sc.setParameters("dc", dcId);
|
sc.setParameters("dc", dcId);
|
||||||
List<HostVO> storageHosts = listBy(sc);
|
List<HostVO> storageHosts = listBy(sc);
|
||||||
|
|
||||||
if (storageHosts == null) {
|
if (storageHosts == null || storageHosts.size() < 1) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return storageHosts.get(0);
|
return storageHosts.get(0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user