bug 13041: Fix potential NPE

I haven't figure out why the code can NPE, and in my test the clean up of basic
zone is prevent from API as expected. Anyway, I add this check before cleanup to
ensure even API check failed, no NPE would be throwed.

status 13041: resolved fixed.
This commit is contained in:
Sheng Yang 2012-01-17 21:34:26 -08:00
parent 08636d5802
commit ab667cbc16

View File

@ -3111,6 +3111,10 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
ReservationContext context = new ReservationContextImpl(null, null, callerUser, callerAccount);
if (cleanup) {
if (network.getGuestType() != GuestType.Isolated) {
s_logger.warn("Only support clean up network for isolated network!");
return false;
}
//shutdown the network
s_logger.debug("Shutting down the network id=" + networkId + " as a part of network restart");