mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +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);
|
||||
List<HostVO> storageHosts = listBy(sc);
|
||||
|
||||
if (storageHosts == null) {
|
||||
if (storageHosts == null || storageHosts.size() < 1) {
|
||||
return null;
|
||||
} else {
|
||||
return storageHosts.get(0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user