Skip to content

Commit

Permalink
Fix MessagePackSecurity.GetEqualityComparer<object> to not return null
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Feb 7, 2020
1 parent c072430 commit e08c4c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Expand Up @@ -44,6 +44,7 @@ private MessagePackSecurity()
/// </summary>
/// <param name="copyFrom">The template to copy from.</param>
protected MessagePackSecurity(MessagePackSecurity copyFrom)
: this()
{
if (copyFrom is null)
{
Expand Down
Expand Up @@ -125,6 +125,13 @@ public void EqualityComparer_ObjectFallback()
Assert.NotEqual(eq.GetHashCode(o), eq.GetHashCode(new object()));
}

[Fact]
public void EqualityComparer_ObjectFallback_AfterCopyCtor()
{
var security = MessagePackSecurity.UntrustedData.WithMaximumObjectGraphDepth(15);
Assert.NotNull(security.GetEqualityComparer<object>());
}

/// <summary>
/// Verifies that arbitrary other types not known to be hash safe will be rejected.
/// </summary>
Expand Down

0 comments on commit e08c4c1

Please sign in to comment.