From 71fbd9271ef129af0e38e3d157a396e62dc5facd Mon Sep 17 00:00:00 2001 From: Alexander Trost Date: Mon, 30 Jan 2023 17:09:36 +0100 Subject: [PATCH] activity: fix ip validity check (#159) --- internal/cron/activity_cron.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cron/activity_cron.go b/internal/cron/activity_cron.go index 1b3ac6a..3221049 100644 --- a/internal/cron/activity_cron.go +++ b/internal/cron/activity_cron.go @@ -49,7 +49,7 @@ func (ac *activityCron) Run(ctx context.Context) error { for _, v := range activity { // Delete any activity that has an invalid IP address. This is a fix for // a bug that truncated the last octet of an IPv6 address in the database. - if err := net.ParseIP(v.IP); err != nil { + if ip := net.ParseIP(v.IP); ip == nil { ids = append(ids, v.ID) continue }