From 9171e4d2314d54ea78f03c8a7949609c070061c8 Mon Sep 17 00:00:00 2001 From: gammazero Date: Thu, 13 Jul 2023 06:18:45 -0700 Subject: [PATCH] handle nil dh result --- pkg/verify/ingest.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/verify/ingest.go b/pkg/verify/ingest.go index 09e13b8..061c26a 100644 --- a/pkg/verify/ingest.go +++ b/pkg/verify/ingest.go @@ -669,11 +669,7 @@ func verifyIngest(cctx *cli.Context, find *client.Client, dhFind *client.DHashCl return result, nil } - if dhFind != nil { - fmt.Println("🔒 Reader privacy enabled") - } - - if len(response.MultihashResults) == 0 { + if response == nil || len(response.MultihashResults) == 0 { result.Absent = mhsCount return result, nil } @@ -724,6 +720,7 @@ func doDHFind(ctx context.Context, cl *client.DHashClient, mhs []multihash.Multi resp.MultihashResults = append(resp.MultihashResults, r.MultihashResults...) } } + fmt.Println("🔒 Reader privacy enabled") return resp, nil }