Skip to content

Commit

Permalink
checks whether an entry is already present before adding it
Browse files Browse the repository at this point in the history
  • Loading branch information
yseto committed Sep 4, 2023
1 parent 6463191 commit 74a047d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api_client_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ func RegisterDefaultSerializer(metaFactory func() s.SerializationWriterFactory)
if err == nil && contentType != "" {
registry := s.DefaultSerializationWriterFactoryInstance
registry.Lock()
registry.ContentTypeAssociatedFactories[contentType] = factory
if _, ok := registry.ContentTypeAssociatedFactories[contentType]; !ok {
registry.ContentTypeAssociatedFactories[contentType] = factory
}
registry.Unlock()
}
}
Expand Down

0 comments on commit 74a047d

Please sign in to comment.