server: Fix stop VM issue on basic zones (#3501)

CloudStack reports an error while stopping/expunging VMs on basic zones

Fixes #3497
This commit is contained in:
Nicolas Vazquez 2019-07-23 11:08:52 -03:00 committed by Rohit Yadav
parent 5690cd6364
commit 281148d551
1 changed files with 3 additions and 1 deletions

View File

@ -198,7 +198,9 @@ public class BasicNetworkVisitor extends NetworkTopologyVisitor {
final DeployDestination destination = dhcp.getDestination();
final boolean remove = dhcp.isRemove();
if (router.getPodIdToDeployIn().longValue() == destination.getPod().getId()) {
if (router != null && (remove || (destination != null && destination.getPod() != null &&
router.getPodIdToDeployIn() != null &&
router.getPodIdToDeployIn().longValue() == destination.getPod().getId()))) {
_commandSetupHelper.createDhcpEntryCommand(router, userVM, nicVo, remove, commands);
return _networkGeneralHelper.sendCommandsToRouter(router, commands);