【礼包】礼包不存在添加判空操作,不再卡死

dev_chengFeng
gaoxin 2021-06-09 11:49:11 +08:00
parent 3c8ada285b
commit cdfb7277f9
1 changed files with 12 additions and 8 deletions

View File

@ -38,7 +38,8 @@ function this.SetBasicValues(giftGoodsList)
end
for _, giftGoodsInfo in ipairs(giftGoodsList) do
if giftGoodsInfo.goodsId and giftGoodsInfo.goodsId ~= 0 then
local rechargeConfigLocal = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig, giftGoodsInfo.goodsId)
local rechargeConfigLocal = ConfigManager.TryGetConfigData(ConfigName.RechargeCommodityConfig, giftGoodsInfo.goodsId)
if rechargeConfigLocal then
-- LogBlue("------充值活动-----------礼包类型:".. rechargeConfigLocal.Type .." 礼包ID".. giftGoodsInfo.goodsId .." 已购:"
-- ..giftGoodsInfo.buyTimes.." 开始:"..giftGoodsInfo.startTime.." 结束:"
-- ..giftGoodsInfo.endTime .. " 可购(没卵用)" .. giftGoodsInfo.dynamicBuyTimes)
@ -48,6 +49,9 @@ function this.SetBasicValues(giftGoodsList)
table.insert(giftGoodsInfoList[rechargeConfigLocal.Type], giftGoodsInfo)
end
end
else
LogError("服务器发过来一个前端表中不存在的礼包:"..giftGoodsInfo.goodsId)
end
end
end
Game.GlobalEvent:DispatchEvent(GameEvent.FindFairy.RefreshBuyOpenState)