Skip to content

Commit 186b56b

Browse files
authored
Merge pull request #1444 from netomi/fix-get-max-download-count-method
Fix: coalesce the max download count in case the database is empty
2 parents 0e0ae15 + f0c5388 commit 186b56b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/org/eclipse/openvsx/repositories/ExtensionRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public interface ExtensionRepository extends Repository<Extension, Long> {
3737

3838
long count();
3939

40-
@Query("select max(e.downloadCount) from Extension e")
40+
@Query("select coalesce(max(e.downloadCount), 0) from Extension e")
4141
int getMaxDownloadCount();
4242

4343
@Query("select e from Extension e where concat(e.namespace.name, '.', e.name) not in(?1)")

0 commit comments

Comments
 (0)