From 62ed0e030c356d617811f17408c6cea1b8d9f7f2 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Mon, 5 Jun 2023 22:00:52 +0200 Subject: [PATCH] added error handling --- src/models/ip.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/models/ip.go b/src/models/ip.go index b22f148..7c2744c 100644 --- a/src/models/ip.go +++ b/src/models/ip.go @@ -206,7 +206,10 @@ func ScanOrphan(wg *sync.WaitGroup, orphans chan IP, done chan bool, thr int, cf log.Printf("%s -> \"%s\"\n", orphan.IP, query.Rdns) } - orphan.GetOrCreate(session) + _, err = orphan.GetOrCreate(session) + if err != nil { + continue + } err = session.Commit() if err != nil {