diff --git a/app/admin/hdl/hdl_scheme.go b/app/admin/hdl/hdl_scheme.go index 8b2b80a..af6df0e 100644 --- a/app/admin/hdl/hdl_scheme.go +++ b/app/admin/hdl/hdl_scheme.go @@ -43,13 +43,15 @@ func SchemeList(c *gin.Context) { e.OutErr(c, e.ERR_DB_ORM, err2.Error()) return } - temp.EnterpriseList = append(temp.EnterpriseList, struct { - Id int `json:"id"` - Name string `json:"name"` - }{ - Id: enterprise.Id, - Name: enterprise.Name, - }) + if enterprise != nil { + temp.EnterpriseList = append(temp.EnterpriseList, struct { + Id int `json:"id"` + Name string `json:"name"` + }{ + Id: enterprise.Id, + Name: enterprise.Name, + }) + } } result = append(result, &temp) }