Forráskód Böngészése

feat:处理空指针问题

wangchuanjin 1 éve
szülő
commit
5b3f82b801
1 módosított fájl, 3 hozzáadás és 2 törlés
  1. 3 2
      jyBXBase/rpc/model/newestBidding.go

+ 3 - 2
jyBXBase/rpc/model/newestBidding.go

@@ -1,7 +1,6 @@
 package model
 
 import (
-	"app.yhyue.com/moapp/jybase/redis"
 	"context"
 	"encoding/json"
 	"fmt"
@@ -15,6 +14,8 @@ import (
 	"strings"
 	"time"
 
+	"app.yhyue.com/moapp/jybase/redis"
+
 	MC "app.yhyue.com/moapp/jybase/common"
 	ME "app.yhyue.com/moapp/jybase/encrypt"
 	elastic "app.yhyue.com/moapp/jybase/es"
@@ -124,7 +125,7 @@ func (n *NewestInfo) GetPushHistory() (res []*bxbase.NewestList) {
 	t := time.Now()
 	list := n.MysqlDb.SelectBySql(findSQL, n.NewsLimitNum)
 	log.Println("SQL 订阅信息耗时:", time.Since(t))
-	if len(*list) > 0 && list != nil {
+	if list != nil && len(*list) > 0 {
 		m := map[string]bool{}
 		es_ids := []string{}
 		infos := map[string]*bxbase.NewestList{}