Skip to content

Commit 2e9b3d8

Browse files
committed
Merge release branch 4.18 to main
* 4.18: server: fix mysql error when list Shared templates for project (#8020)
2 parents 5c5ea09 + 3d8cc63 commit 2e9b3d8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/src/main/java/com/cloud/api/query/QueryManagerImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3786,6 +3786,9 @@ else if (!template.isPublicTemplate() && caller.getType() != Account.Type.ADMIN)
37863786
}
37873787
} else if (templateFilter == TemplateFilter.sharedexecutable || templateFilter == TemplateFilter.shared) {
37883788
// only show templates shared by others
3789+
if (permittedAccounts.isEmpty()) {
3790+
return new Pair<>(new ArrayList<>(), 0);
3791+
}
37893792
sc.addAnd("sharedAccountId", SearchCriteria.Op.IN, permittedAccountIds.toArray());
37903793
} else if (templateFilter == TemplateFilter.executable) {
37913794
SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria();

0 commit comments

Comments
 (0)