Skip to content

Commit 89ce8bd

Browse files
committed
CLOUDSTACK-8958: throw an exception if project account cannot be found
1 parent 37301ed commit 89ce8bd

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

server/src/com/cloud/configuration/ConfigurationManagerImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,6 +2618,9 @@ public Vlan createVlanAndPublicIpRange(final CreateVlanIpRangeCmd cmd) throws In
26182618
}
26192619

26202620
vlanOwner = _accountMgr.getAccount(project.getProjectAccountId());
2621+
if (vlanOwner == null) {
2622+
throw new InvalidParameterValueException("Please specify a valid projectId");
2623+
}
26212624
}
26222625

26232626
Domain domain = null;
@@ -3329,6 +3332,9 @@ public Vlan dedicatePublicIpRange(final DedicatePublicIpRangeCmd cmd) throws Res
33293332
throw new InvalidParameterValueException("Unable to find project by id " + projectId);
33303333
}
33313334
vlanOwner = _accountMgr.getAccount(project.getProjectAccountId());
3335+
if (vlanOwner == null) {
3336+
throw new InvalidParameterValueException("Please specify a valid projectId");
3337+
}
33323338
}
33333339

33343340
Domain domain = null;

0 commit comments

Comments
 (0)