From 2bdf2ac12d3fc2770cd101cc30c221255a7fdff6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Apr 2023 21:11:23 -0600 Subject: btrfsutil: noopRebuiltForrestCallbacks: Add a missing failure-check --- lib/btrfsutil/rebuilt_forrest.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/btrfsutil/rebuilt_forrest.go b/lib/btrfsutil/rebuilt_forrest.go index 60f3010..fcfb353 100644 --- a/lib/btrfsutil/rebuilt_forrest.go +++ b/lib/btrfsutil/rebuilt_forrest.go @@ -47,6 +47,9 @@ func (cb noopRebuiltForrestCallbacks) LookupRoot(ctx context.Context, tree btrfs key.Offset = 0 return tgt.Compare(key) }) + if !ok { + return 0, btrfsitem.Root{}, false + } itemBody := cb.forrest.readItem(ctx, itemPtr) defer itemBody.Free() switch itemBody := itemBody.(type) { -- cgit v1.2.3-54-g00ecf