mirror of
https://github.com/rclone/rclone.git
synced 2025-01-03 12:59:32 +01:00
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
@ -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
|
// Set the mod time now and read metadata
|
||||||
info, err = o.fs.fetchAndUpdateMetadata(ctx, src, options, o)
|
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)
|
return info, o.setMetaData(info)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user