This commit is contained in:
邹宗楠
2023-06-30 18:01:11 +08:00
parent 8042b7514e
commit 5c096fd7d0
2 changed files with 11 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ func (a *API) GetStoreAllCategory() ([]*CategoryInfo, error) {
result := make([]*CategoryInfo, 0)
for _, v := range parent.ChildCategorys {
childNode, err := a.GetStoreCategoryInfo(v.Code)
if err != nil || len(childNode.ChildCategorys) == 0 {
if err != nil || childNode == nil {
result = append(result, &CategoryInfo{
ChildCategorys: nil,
Code: v.Code,