diff --git a/bubble-server/src/main/java/bubble/dao/cloud/CloudServiceDAO.java b/bubble-server/src/main/java/bubble/dao/cloud/CloudServiceDAO.java index 7eebb0ae..f2defe2d 100644 --- a/bubble-server/src/main/java/bubble/dao/cloud/CloudServiceDAO.java +++ b/bubble-server/src/main/java/bubble/dao/cloud/CloudServiceDAO.java @@ -21,6 +21,7 @@ import org.springframework.stereotype.Repository; import javax.annotation.Nullable; import javax.transaction.Transactional; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; @@ -123,7 +124,9 @@ public class CloudServiceDAO extends AccountOwnedTemplateDAO { } public List findByFirstAdminAndType(CloudServiceType csType) { - return findByFields("account", accountDAO.getFirstAdmin().getUuid(), "type", csType, "enabled", true); + final Account firstAdmin = accountDAO.getFirstAdmin(); + if (firstAdmin == null) return new ArrayList<>(); + return findByFields("account", firstAdmin.getUuid(), "type", csType, "enabled", true); } public boolean adminHasType(CloudServiceType csType) {