DaanHoogland commented on code in PR #8020:
URL: https://github.com/apache/cloudstack/pull/8020#discussion_r1342301587


##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -3758,6 +3758,9 @@ else if (!template.isPublicTemplate() && caller.getType() 
!= Account.Type.ADMIN)
                 }
             } else if (templateFilter == TemplateFilter.sharedexecutable || 
templateFilter == TemplateFilter.shared) {
                 // only show templates shared by others
+                if (permittedAccounts.isEmpty()) {
+                    return new Pair<>(new ArrayList<>(), 0);
+                }
                 sc.addAnd("sharedAccountId", SearchCriteria.Op.IN, 
permittedAccountIds.toArray());

Review Comment:
   I researched a little and the handling of an empty set is going to be just 
as ugly. Let's go with this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to