Skip to content

Commit 3d8cc63

Browse files
server: fix mysql error when list Shared templates for project (#8020)
1 parent 96205a5 commit 3d8cc63

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
@@ -3758,6 +3758,9 @@ else if (!template.isPublicTemplate() && caller.getType() != Account.Type.ADMIN)
37583758
}
37593759
} else if (templateFilter == TemplateFilter.sharedexecutable || templateFilter == TemplateFilter.shared) {
37603760
// only show templates shared by others
3761+
if (permittedAccounts.isEmpty()) {
3762+
return new Pair<>(new ArrayList<>(), 0);
3763+
}
37613764
sc.addAnd("sharedAccountId", SearchCriteria.Op.IN, permittedAccountIds.toArray());
37623765
} else if (templateFilter == TemplateFilter.executable) {
37633766
SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria();

0 commit comments

Comments
 (0)