浏览代码

wip:断言判断

wangshan 11 月之前
父节点
当前提交
0c085257fd
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      entity/subscribe.go

+ 6 - 4
entity/subscribe.go

@@ -276,10 +276,12 @@ func (this *UserInfoReq) EntnicheSub() *map[string]interface{} {
 		})
 		log.Println(res_, "+++")
 		if len(res_) > 0 {
-			oenitche, _ := (*res)["o_entniche"].(map[string]interface{})
-			oenitche["a_buyerclass"] = res_["a_buyerclass"]
-			oenitche["a_items"] = res_["a_items"]
-			oenitche["o_area"] = res_["o_area"]
+			oenitche, ok := (*res)["o_entniche"].(map[string]interface{})
+			if ok && oenitche != nil {
+				oenitche["a_buyerclass"] = res_["a_buyerclass"]
+				oenitche["a_items"] = res_["a_items"]
+				oenitche["o_area"] = res_["o_area"]
+			}
 			(*res)["o_entniche"] = oenitche
 		}
 	case 2: