Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 9314116

Browse files
committed
[proxy]修改统计中日志扩展信息可能为nil的问题
1 parent 19e87e9 commit 9314116

6 files changed

Lines changed: 18 additions & 0 deletions

File tree

teastats/browser_all_period.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ func (this *BrowserAllPeriodFilter) Start(queue *Queue, code string) {
4343
}
4444

4545
func (this *BrowserAllPeriodFilter) Filter(accessLog *accesslogs.AccessLog) {
46+
if accessLog.Extend == nil {
47+
return
48+
}
4649
if len(accessLog.Extend.Client.Browser.Family) == 0 {
4750
return
4851
}

teastats/city_all_period.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ func (this *CityAllPeriodFilter) Start(queue *Queue, code string) {
4343
}
4444

4545
func (this *CityAllPeriodFilter) Filter(accessLog *accesslogs.AccessLog) {
46+
if accessLog.Extend == nil {
47+
return
48+
}
4649
if len(accessLog.Extend.Geo.City) == 0 {
4750
return
4851
}

teastats/device_all_period.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ func (this *DeviceAllPeriodFilter) Start(queue *Queue, code string) {
4343
}
4444

4545
func (this *DeviceAllPeriodFilter) Filter(accessLog *accesslogs.AccessLog) {
46+
if accessLog.Extend == nil {
47+
return
48+
}
4649
if len(accessLog.Extend.Client.Device.Family) == 0 {
4750
return
4851
}

teastats/os_all_period.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ func (this *OSAllPeriodFilter) Start(queue *Queue, code string) {
4343
}
4444

4545
func (this *OSAllPeriodFilter) Filter(accessLog *accesslogs.AccessLog) {
46+
if accessLog.Extend == nil {
47+
return
48+
}
4649
if len(accessLog.Extend.Client.OS.Family) == 0 {
4750
return
4851
}

teastats/province_all_period.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ func (this *ProvinceAllPeriodFilter) Start(queue *Queue, code string) {
4343
}
4444

4545
func (this *ProvinceAllPeriodFilter) Filter(accessLog *accesslogs.AccessLog) {
46+
if accessLog.Extend == nil {
47+
return
48+
}
4649
if len(accessLog.Extend.Geo.State) == 0 {
4750
return
4851
}

teastats/region_all_period.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ func (this *RegionAllPeriodFilter) Start(queue *Queue, code string) {
4343
}
4444

4545
func (this *RegionAllPeriodFilter) Filter(accessLog *accesslogs.AccessLog) {
46+
if accessLog.Extend == nil {
47+
return
48+
}
4649
if len(accessLog.Extend.Geo.Region) == 0 {
4750
return
4851
}

0 commit comments

Comments
 (0)