Fix NPE with volume reservation

This commit is contained in:
Prachi Damle 2013-01-23 16:41:05 -08:00
parent baae73cc05
commit e67381b76d

View File

@ -196,9 +196,9 @@ public class VMEntityManagerImpl implements VMEntityManager {
Long poolId = null;
Map<Long,Long> storage = vmReservation.getVolumeReservation();
if(storage != null){
List<Long> poolIdList = new ArrayList<Long>(storage.keySet());
if(poolIdList !=null && !poolIdList.isEmpty()){
poolId = poolIdList.get(0);
List<Long> volIdList = new ArrayList<Long>(storage.keySet());
if(volIdList !=null && !volIdList.isEmpty()){
poolId = storage.get(volIdList.get(0));
}
}