GabrielBrascher opened a new pull request #4279: URL: https://github.com/apache/cloudstack/pull/4279
## Description <!--- Describe your changes in detail --> When executing request [assignVirtualMachine](https://cloudstack.apache.org/api/apidocs-4.14/apis/assignVirtualMachine.html) with null `domainID` and a valid `projectID` then a `NullPointerException` happens at [DomainChecker.java](https://github.com/apache/cloudstack/blob/bb73bedb5511880c91abaa409462ba879cb0d7b7/server/src/main/java/com/cloud/acl/DomainChecker.java#L109). Command example: ``` assign virtualmachine virtualmachineid=VM-ID projectid=ProjectID account=admin ``` The `NullPointerException` that is thrown at `DomainChecker` is handled at [AssignVMCmd.java#L142](https://github.com/apache/cloudstack/blob/bb73bedb5511880c91abaa409462ba879cb0d7b7/api/src/main/java/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java#L142), resulting in the following log message: `Failed to move vm null`. **My question is:** does it make sense to assign VM to a project with `domainID=null`? If so, then the handling should be different. However, I think that it should not be `null` and therefore I added a proper log message. Prior to commit ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) ## How Has This Been Tested? Via API request of API command [assignVirtualMachine](https://cloudstack.apache.org/api/apidocs-4.14/apis/assignVirtualMachine.html). ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
