Skip to content

Commit 93150f4

Browse files
authored
api: Fix list templates when no secondary stores present (#5468)
1 parent 22a0c0a commit 93150f4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

engine/storage/src/main/java/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,9 @@ public List<TemplateDataStoreVO> listByTemplateNotBypassed(long templateId, Long
427427
sc.setParameters("template_id", templateId);
428428
sc.setParameters("download_state", Status.BYPASSED);
429429
sc.setParameters("destroyed", false);
430-
sc.setParameters("storeids", storeIds);
430+
if (storeIds != null && storeIds.length > 0) {
431+
sc.setParameters("storeids", storeIds);
432+
}
431433
return search(sc, null);
432434
}
433435

0 commit comments

Comments
 (0)