mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
CLOUDSTACK-1401 NPE: listCapacity
This commit is contained in:
parent
9afd33d206
commit
91417115ef
@ -305,10 +305,17 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
|
||||
}
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
Long capacityPodId = null;
|
||||
Long capacityClusterId = null;
|
||||
|
||||
if(level != 1 && rs.getLong(6) != 0)
|
||||
capacityPodId = rs.getLong(6);
|
||||
if(level == 3 && rs.getLong(7) != 0)
|
||||
capacityClusterId = rs.getLong(7);
|
||||
|
||||
SummedCapacity summedCapacity = new SummedCapacity( rs.getLong(1), rs.getLong(2), rs.getFloat(3),
|
||||
(short)rs.getLong(4), rs.getLong(5),
|
||||
level != 1 ? rs.getLong(6): null,
|
||||
level == 3 ? rs.getLong(7): null);
|
||||
capacityPodId, capacityClusterId);
|
||||
|
||||
result.add(summedCapacity);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user