Skip to content

Commit

Permalink
Merge pull request #907 from MissionCriticalCloud/fix/npe-no-gateway
Browse files Browse the repository at this point in the history
Prevent NPE when gateway is not present
  • Loading branch information
Alexander authored Sep 21, 2020
2 parents b75a895 + d5d852b commit 52bbf44
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ private String assignGuestOrGatewayIp(final Network network, final NicProfile ni

s_logger.debug("Check if the gateway ip is requested");
// Check if we can assign the gateway
if (nic.getIPv4Gateway().equals(nic.getRequestedIPv4())) {
if (nic.getIPv4Gateway() != null && nic.getIPv4Gateway().equals(nic.getRequestedIPv4())) {
s_logger.debug("VM requests gateway ip address for network " + network.getName() + " with offering " + networkOffering.getName() + " . Check service offering");

final boolean networkOfferingSupportsGatewayService = _networkOfferingServiceMapDao.areServicesSupportedByNetworkOffering(networkOfferingId, Service.Gateway);
Expand Down

0 comments on commit 52bbf44

Please # to comment.