mirror of https://github.com/apache/cloudstack.git
fix NPE cases, throw exceptions early on
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
9658569f5a
commit
68b5440d44
|
|
@ -698,7 +698,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
|
|||
|
||||
@Override
|
||||
public Object unmarshallResultObject(AsyncJob job) {
|
||||
if(job.getResult() != null)
|
||||
if(job != null && job.getResult() != null)
|
||||
return JobSerializerHelper.fromObjectSerializedString(job.getResult());
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4027,6 +4027,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
|||
diskdef.defBlockBasedDisk(device, devId, DiskDef.diskBus.VIRTIO);
|
||||
diskdef.setQemuDriver(false);
|
||||
vm.getDevices().addDevice(diskdef);
|
||||
} else {
|
||||
throw new InternalErrorException("Error while mapping RBD device on host");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -363,6 +363,9 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
|
|||
storage.create(0);
|
||||
}
|
||||
LibvirtStoragePoolDef spd = getStoragePoolDef(conn, storage);
|
||||
if (spd == null) {
|
||||
throw new CloudRuntimeException("Unable to parse the storage pool definition for storage pool " + uuid);
|
||||
}
|
||||
StoragePoolType type = null;
|
||||
if (spd.getPoolType() == LibvirtStoragePoolDef.poolType.NETFS) {
|
||||
type = StoragePoolType.NetworkFilesystem;
|
||||
|
|
|
|||
Loading…
Reference in New Issue