浏览代码

avoid NPE when launching and a session somehow exists

tags/v1.4.16^0
Jonathan Cobb 4 年前
父节点
当前提交
eaa2c68f2f
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      bubble-server/src/main/java/bubble/dao/cloud/CloudServiceDAO.java

+ 4
- 1
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<CloudService> {
}

public List<CloudService> 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) {


正在加载...
取消
保存