This is an automated email from the ASF dual-hosted git repository.

nvazquez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new 93150f4  api: Fix list templates when no secondary stores present 
(#5468)
93150f4 is described below

commit 93150f465b40723694edaa4e7e158d4523bea7a3
Author: Pearl Dsilva <[email protected]>
AuthorDate: Mon Sep 20 22:37:47 2021 +0530

    api: Fix list templates when no secondary stores present (#5468)
---
 .../apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/engine/storage/src/main/java/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java
 
b/engine/storage/src/main/java/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java
index 8aa4114..bac01ad 100644
--- 
a/engine/storage/src/main/java/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java
+++ 
b/engine/storage/src/main/java/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java
@@ -427,7 +427,9 @@ public class TemplateDataStoreDaoImpl extends 
GenericDaoBase<TemplateDataStoreVO
         sc.setParameters("template_id", templateId);
         sc.setParameters("download_state", Status.BYPASSED);
         sc.setParameters("destroyed", false);
-        sc.setParameters("storeids", storeIds);
+        if (storeIds != null && storeIds.length > 0) {
+            sc.setParameters("storeids", storeIds);
+        }
         return search(sc, null);
     }
 

Reply via email to