fix: a crash in RemoveReplication target (#19640)

calling a remote target remove with a perfectly
well constructed ARN can lead to a crash for a bucket
with no replication configured.

This PR fixes, and adds a crash check for ImportMetadata
as well.
This commit is contained in:
Harshavardhana
2024-04-30 18:09:56 -07:00
committed by GitHub
parent f64dea2aac
commit 8161411c5d
5 changed files with 5 additions and 5 deletions

View File

@@ -998,7 +998,7 @@ func replicateObject(ctx context.Context, ri ReplicateObjectInfo, objectAPI Obje
object := ri.Name
cfg, err := getReplicationConfig(ctx, bucket)
if err != nil {
if err != nil || cfg == nil {
replLogOnceIf(ctx, err, "get-replication-config-"+bucket)
sendEvent(eventArgs{
EventName: event.ObjectReplicationNotTracked,