CLOUDSTACK-1207. UpdateNetwork API fails with NPE if the network offering is not being updated and is non-persistent.

This commit is contained in:
Likitha Shetty 2013-02-15 16:46:01 +05:30
parent bc493bd39b
commit 3c764c0be7

View File

@ -1711,7 +1711,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
// 4) if network has been upgraded from a non persistent ntwk offering to a persistent ntwk offering,
// implement the network if its not already
if ( !oldNtwkOff.getIsPersistent() && networkOffering.getIsPersistent()) {
if ( networkOfferingChanged && !oldNtwkOff.getIsPersistent() && networkOffering.getIsPersistent()) {
if( network.getState() == Network.State.Allocated) {
try {
DeployDestination dest = new DeployDestination(_dcDao.findById(network.getDataCenterId()), null, null, null);