null deref when no project found

This commit is contained in:
Will Stevens 2014-09-05 10:06:25 -04:00
parent 0ec36e128b
commit b145a7d140
1 changed files with 7 additions and 2 deletions

View File

@ -302,8 +302,13 @@ public class CertServiceImpl implements CertService {
if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
// find the project
Project project = _projectMgr.findByProjectAccountIdIncludingRemoved(account.getId());
response.setProjectId(project.getUuid());
response.setProjectName(project.getName());
if (project != null)
{
response.setProjectId(project.getUuid());
response.setProjectName(project.getName());
} else {
response.setAccountName(account.getAccountName());
}
} else {
response.setAccountName(account.getAccountName());
}