Skip to content

Commit

Permalink
[#1] - Defaulting the list of HalJsonMediaTypeFormatters if a null or…
Browse files Browse the repository at this point in the history
… empty list is provided.
  • Loading branch information
eoin55 committed Feb 29, 2016
1 parent f0319ba commit 2df3f8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Src/HoneyBear.HalClient/HalClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class HalClient : IHalClient
private readonly IEnumerable<MediaTypeFormatter> _formatters;
private IEnumerable<IResource> _current = Enumerable.Empty<IResource>();

private static readonly IEnumerable<MediaTypeFormatter> _defaultFormatters =
private static readonly ICollection<MediaTypeFormatter> _defaultFormatters =
new[] {new HalJsonMediaTypeFormatter()};

/// <summary>
Expand All @@ -32,10 +32,10 @@ public class HalClient : IHalClient
/// </param>
public HalClient(
HttpClient client,
IEnumerable<MediaTypeFormatter> formatters)
ICollection<MediaTypeFormatter> formatters)
{
_client = new JsonHttpClient(client);
_formatters = formatters;
_formatters = formatters == null || !formatters.Any() ? _defaultFormatters : formatters;
}

/// <summary>
Expand Down

0 comments on commit 2df3f8c

Please sign in to comment.