From e7a1a0bf3fd7709c62d2eaf295c43e0136d8c415 Mon Sep 17 00:00:00 2001 From: Carson Ip Date: Wed, 17 Jul 2024 15:14:42 +0100 Subject: [PATCH] Fix test --- model/modelpb/ip.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/model/modelpb/ip.go b/model/modelpb/ip.go index efc9966f..4d2ea66f 100644 --- a/model/modelpb/ip.go +++ b/model/modelpb/ip.go @@ -56,6 +56,9 @@ func Addr2IP(addr netip.Addr) *IP { // IP2Addr converts a valid IP to netip.Addr. func IP2Addr(i *IP) netip.Addr { + if i == nil { + return netip.Addr{} + } if addr := i.GetV6(); len(addr) == 16 { return netip.AddrFrom16([16]byte(addr)) }