feat(dashboard): traverse file URI from file ID (#2412)

This commit is contained in:
Aaron Liu
2025-05-29 09:44:11 +08:00
parent 65095855c1
commit 51fa9f66a5
9 changed files with 67 additions and 3 deletions

View File

@@ -450,7 +450,7 @@ func (f *DBFS) Get(ctx context.Context, path *fs.URI, opts ...fs.Option) (fs.Fil
return nil, fmt.Errorf("failed to get target file: %w", err)
}
if o.notRoot && target.IsRootFolder() {
if o.notRoot && (target == nil || target.IsRootFolder()) {
return nil, fs.ErrNotSupportedAction.WithError(fmt.Errorf("cannot operate root file"))
}