onedrive: fix nil pointer error when uploading small files
Before this fix when uploading a single part file, if the o.fetchAndUpdateMetadata() call failed rclone would call o.setMetaData() with a nil info which caused a crash. This fixes the problem by returning the error from o.fetchAndUpdateMetadata() explicitly. See: https://forum.rclone.org/t/serve-webdav-is-crashing-fatal-error-sync-unlock-of-unlocked-mutex/46300
This commit is contained in:
parent
4ed4483bbc
commit
5511fa441a
1 changed files with 3 additions and 0 deletions
|
@ -2538,6 +2538,9 @@ func (o *Object) uploadSinglepart(ctx context.Context, in io.Reader, src fs.Obje
|
|||
}
|
||||
// Set the mod time now and read metadata
|
||||
info, err = o.fs.fetchAndUpdateMetadata(ctx, src, options, o)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to fetch and update metadata: %w", err)
|
||||
}
|
||||
return info, o.setMetaData(info)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue