From 7b24d98dd51d9374afc1b66996adf1a62350eb7c Mon Sep 17 00:00:00 2001 From: Leufolium Date: Tue, 16 Apr 2024 19:01:33 +0800 Subject: [PATCH 1/2] By Robin at 20240416 --- app/mix/service/utilservice.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/mix/service/utilservice.go b/app/mix/service/utilservice.go index c8a766cb..6a860096 100644 --- a/app/mix/service/utilservice.go +++ b/app/mix/service/utilservice.go @@ -1559,14 +1559,15 @@ func (s *Service) utilFillZonesWithApiVOInfo(ctx *gin.Context, list []*dbstruct. vo.Expenditure = zidZuMap[zid].GetConsume() // 填充铁粉解锁信息 - if zidZuMap[zid].IsUnlockIronfanship() { + zu, ok := zidZuMap[zid] + if ok && zu.IsUnlockIronfanship() { vo.IsIronfanshipUnlocked = consts.IsIronfanshipUnlocked_Yes } else { vo.IsIronfanshipUnlocked = consts.IsIronfanshipUnlocked_No } // 填充超粉解锁信息 - if zidZuMap[zid].IsUnlockSuperfanship() { + if ok && zu.IsUnlockSuperfanship() { vo.IsSuperfanshipUnlocked = consts.IsSuperfanshipUnlocked_Yes } else { vo.IsSuperfanshipUnlocked = consts.IsSuperfanshipUnlocked_No From 3940762760cdf6b5afa9d77be52d064d9c577d67 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Tue, 16 Apr 2024 19:04:34 +0800 Subject: [PATCH 2/2] by Robin at 20240416 --- dbstruct/vas_mysql.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dbstruct/vas_mysql.go b/dbstruct/vas_mysql.go index 457da872..0c9dbe47 100644 --- a/dbstruct/vas_mysql.go +++ b/dbstruct/vas_mysql.go @@ -948,6 +948,9 @@ type ZoneUnlock struct { } func (p *ZoneUnlock) IsUnlockAdmission() bool { + if p == nil { + return false + } if p.AdmissionCt == nil { return false } @@ -958,6 +961,9 @@ func (p *ZoneUnlock) IsUnlockAdmission() bool { } func (p *ZoneUnlock) IsUnlockIronfanship() bool { + if p == nil { + return false + } if p.IronfanshipCt == nil { return false } @@ -968,6 +974,9 @@ func (p *ZoneUnlock) IsUnlockIronfanship() bool { } func (p *ZoneUnlock) IsUnlockSuperfanship() bool { + if p == nil { + return false + } if p.SuperfanshipCt == nil { return false }