Skip to content

Commit

Permalink
灵异事件
Browse files Browse the repository at this point in the history
  • Loading branch information
Sakura-Byte committed Jan 3, 2025
1 parent cf87567 commit 1bb1568
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/115/115.go
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,11 @@ func (f *Fs) putUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo,
// In this case, the upload (perhaps via hash) could be successful,
/// so let the subsequent process locate the uploaded object.
}

if newObj == nil {
return nil, fmt.Errorf("upload returned nil object without error")
}

o := newObj.(*Object)

if o.hasMetaData {
Expand Down
9 changes: 9 additions & 0 deletions backend/115/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,9 @@ func (f *Fs) upload(
}
if gotIt {
// Fast upload successful
if o == nil {
return nil, fmt.Errorf("秒传 upload returned nil object without error")
}
return o, nil
}
// Fallback to uploadToOSS using the obtained UploadInitInfo
Expand Down Expand Up @@ -683,6 +686,9 @@ func (f *Fs) upload(
return nil, err
}
if gotIt {
if o == nil {
return nil, fmt.Errorf("秒传 upload returned nil object without error")
}
return o, nil
}
// No fallback for UploadHashOnly
Expand All @@ -704,6 +710,9 @@ func (f *Fs) upload(
return f.uploadToOSS(ctx, in, src, o, leaf, dirID, size, ui, options...)
}
if gotIt {
if o == nil {
return nil, fmt.Errorf("秒传 upload returned nil object without error")
}
// Fast upload successful
return o, nil
}
Expand Down

0 comments on commit 1bb1568

Please sign in to comment.