This is an automated email from the ASF dual-hosted git repository.
bhaisaab pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/master by this push:
new 55c059c CLOUDSTACK-10144: fix possible NPE in listVlanIpRanges
55c059c is described below
commit 55c059c09887651cab59e292bedafbbf9f1699df
Author: Rene Moser <[email protected]>
AuthorDate: Thu Nov 16 13:43:00 2017 +0100
CLOUDSTACK-10144: fix possible NPE in listVlanIpRanges
---
server/src/com/cloud/api/ApiResponseHelper.java | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java
b/server/src/com/cloud/api/ApiResponseHelper.java
index 99f1b47..0081b9d 100644
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -2365,12 +2365,18 @@ public class ApiResponseHelper implements
ResponseGenerator {
private void populateAccount(ControlledEntityResponse response, long
accountId) {
Account account = ApiDBUtils.findAccountById(accountId);
- if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
+ if (account == null) {
+ s_logger.debug("Unable to find account with id: " + accountId);
+ } else if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
// find the project
Project project =
ApiDBUtils.findProjectByProjectAccountId(account.getId());
- response.setProjectId(project.getUuid());
- response.setProjectName(project.getName());
- response.setAccountName(account.getAccountName());
+ if (project != null) {
+ response.setProjectId(project.getUuid());
+ response.setProjectName(project.getName());
+ response.setAccountName(account.getAccountName());
+ } else {
+ s_logger.debug("Unable to find project with id: " +
account.getId());
+ }
} else {
response.setAccountName(account.getAccountName());
}
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].