Skip to content

Commit d76cb40

Browse files
committed
fix npe in updateObjectStore
1 parent 1123adf commit d76cb40

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

server/src/main/java/com/cloud/storage/StorageManagerImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4336,7 +4336,9 @@ public ObjectStore updateObjectStore(Long id, UpdateObjectStoragePoolCmd cmd) {
43364336
if(cmd.getName() != null ) {
43374337
objectStoreVO.setName(cmd.getName());
43384338
}
4339-
objectStoreVO.setTotalSize(cmd.getSize() * ResourceType.bytesToGiB);
4339+
if (cmd.getSize() != null) {
4340+
objectStoreVO.setTotalSize(cmd.getSize() * ResourceType.bytesToGiB);
4341+
}
43404342
_objectStoreDao.update(id, objectStoreVO);
43414343
logger.debug("Successfully updated object store: {}", objectStoreVO);
43424344
return objectStoreVO;

0 commit comments

Comments
 (0)