mirror of https://github.com/apache/cloudstack.git
Merge pull request #1550 from ustcweizhou/CLOUDSTACK-9380-listDomains-NPE
CLOUDSTACK-9380: fix NPE in listDomains API for a mistakeThe issue happens if volumeTotal is NULL in database.
This is caused by commit 0407fb334f for CLOUDSTACK-7847.
* pr/1550:
CLOUDSTACK-9380: fix NPE in listDomains API for a mistake
Signed-off-by: Will Stevens <williamstevens@gmail.com>
This commit is contained in:
commit
550aabb308
|
|
@ -110,7 +110,7 @@ public class DomainJoinDaoImpl extends GenericDaoBase<DomainJoinVO, Long> implem
|
|||
|
||||
long volumeLimit = ApiDBUtils.findCorrectResourceLimitForDomain(domain.getVolumeLimit(), fullView, ResourceType.volume, domain.getId());
|
||||
String volumeLimitDisplay = (fullView || volumeLimit == -1) ? "Unlimited" : String.valueOf(volumeLimit);
|
||||
long volumeTotal = (domain.getVolumeTotal() == 0) ? 0 : domain.getVolumeTotal();
|
||||
long volumeTotal = (domain.getVolumeTotal() == null) ? 0 : domain.getVolumeTotal();
|
||||
String volumeAvail = (fullView || volumeLimit == -1) ? "Unlimited" : String.valueOf(volumeLimit - volumeTotal);
|
||||
response.setVolumeLimit(volumeLimitDisplay);
|
||||
response.setVolumeTotal(volumeTotal);
|
||||
|
|
|
|||
Loading…
Reference in New Issue