Skip to content
Permalink
Browse files
Fix Optional check
Follow on to d5da738.
  • Loading branch information
gaul committed Oct 14, 2018
1 parent d5da738 commit 96fd453ad48d026ba47d827dcf25089c98486fd0
Showing 1 changed file with 2 additions and 2 deletions.
@@ -178,10 +178,10 @@ private void validateVSwitchId(String regionId,
String securityGroupName,
String vpcIdFromSecurityGroup) {
Optional<VSwitch> optionalVSwitch = tryFindVSwitchInVPC(regionId, vpcIdFromSecurityGroup, vSwitchId);
if (optionalVSwitch.isPresent()) {
if (!optionalVSwitch.isPresent()) {
String message = String.format("security group (%s) and vSwitch (%s) must be in the same VPC_PREFIX (%s)",
securityGroupName,
optionalVSwitch.get().name(),
vSwitchId,
vpcIdFromSecurityGroup);

throw new IllegalStateException(message);

0 comments on commit 96fd453

Please sign in to comment.