From 7be4c908a7295c469aacd06bb399859962b3e89e Mon Sep 17 00:00:00 2001 From: Har01d Date: Thu, 26 Feb 2026 18:51:36 +0800 Subject: [PATCH] check link is nil --- internal/op/fs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/op/fs.go b/internal/op/fs.go index 33579df9..9d93318e 100644 --- a/internal/op/fs.go +++ b/internal/op/fs.go @@ -275,6 +275,9 @@ func Link(ctx context.Context, storage driver.Driver, path string, args model.Li if err != nil { return nil, nil, err } + if ol == nil || ol.link == nil { + return nil, nil, errors.WithStack(errs.ObjectNotFound) + } if ol.link.SyncClosers.AcquireReference() || !ol.link.RequireReference { return ol.link, ol.obj, nil }