From d7d9a251be46020597cffc7878a06c1dfacaf951 Mon Sep 17 00:00:00 2001 From: Chiradeep Vittal Date: Thu, 13 Jan 2011 14:48:09 -0800 Subject: [PATCH] bug 7993: fix npe status 7993: resolved fixed --- server/src/com/cloud/storage/StorageManagerImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 45c376212ca..4bd229a82cd 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -2623,14 +2623,14 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag } Pair created = createVolume(newVol, _diskOfferingDao.findById(newVol.getDiskOfferingId()), vm, vols, dest); if (created == null) { - long poolId = newVol.getPoolId(); + Long poolId = newVol.getPoolId(); newVol.setPoolId(null); try { _volsDao.update(newVol, Volume.Event.OperationFailed); } catch (ConcurrentOperationException e) { throw new CloudRuntimeException("Unable to update the failure on a volume: " + newVol, e); } - throw new StorageUnavailableException("Unable to create " + newVol, poolId); + throw new StorageUnavailableException("Unable to create " + newVol, poolId==null?-1L:poolId); } created.first().setDeviceId(newVol.getDeviceId().intValue()); newVol.setStatus(AsyncInstanceCreateStatus.Created);