Skip to content

Commit f4eab35

Browse files
sanjaytripathidevdeep
authored andcommitted
CLOUDSTACK-3488: listStoragePools throws NPE if any of the storage pools are not in the right state.
This issue is reporducible if user adds a primary storage and quickly fires listStoragePool API command without waiting for the responce of previous createStoragePool API command. So during this period (before receiving createStoragePool API resonce), the primary srorage is in initialized status and the "scope" of storage is not set.
1 parent b466729 commit f4eab35

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ public StoragePoolResponse newStoragePoolResponse(StoragePoolJoinVO pool) {
7575
poolResponse.setPodId(pool.getPodUuid());
7676
poolResponse.setPodName(pool.getPodName());
7777
poolResponse.setCreated(pool.getCreated());
78-
poolResponse.setScope(pool.getScope().toString());
78+
if (pool.getScope() != null) {
79+
poolResponse.setScope(pool.getScope().toString());
80+
}
7981
if (pool.getHypervisor() != null) {
8082
poolResponse.setHypervisor(pool.getHypervisor().toString());
8183
}

0 commit comments

Comments
 (0)