fix: avoid nil panic upon error in GetObjectNInfo via InnerGetObjectNInfoFn (#18198)

This commit is contained in:
jiuker 2023-10-10 23:35:33 +08:00 committed by GitHub
parent 5b8599e52d
commit aaab7aefbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,6 +270,9 @@ func (c *cacheObjects) GetObjectNInfo(ctx context.Context, bucket, object string
cacheReader.Close()
c.cacheStats.incMiss()
bReader, err := c.InnerGetObjectNInfoFn(ctx, bucket, object, rs, h, opts)
if err != nil {
return nil, err
}
bReader.ObjInfo.CacheLookupStatus = CacheHit
bReader.ObjInfo.CacheStatus = CacheMiss
return bReader, err