Skip to content

Commit 321fe2f

Browse files
committed
ensure owner not null
1 parent c731613 commit 321fe2f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

server/src/main/java/org/apache/cloudstack/network/ssl/CertServiceImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ public SslCertResponse uploadSslCert(final UploadSslCertCmd certCmd) {
138138
owner = caller;
139139
}
140140

141+
Preconditions.checkNotNull(owner);
142+
141143
final String cert = certCmd.getCert();
142144
final String key = certCmd.getKey();
143145
final String password = certCmd.getPassword();
@@ -226,12 +228,14 @@ public List<SslCertResponse> listSslCerts(final ListSslCertsCmd listSslCertCmd)
226228
}
227229

228230
Account owner = null;
229-
if (StringUtils.isNotEmpty(accountName)) {
231+
if (StringUtils.isNotBlank(accountName)) {
230232
owner = _accountMgr.finalizeOwner(caller, accountName, domainId, projectId);
231233
} else {
232234
owner = caller;
233235
}
234236

237+
Preconditions.checkNotNull(owner);
238+
235239
final List<SslCertResponse> certResponseList = new ArrayList<SslCertResponse>();
236240

237241
List<LoadBalancerCertMapVO> certLbMap = null;

0 commit comments

Comments
 (0)