Quick fix: Missed `null` checks in 7dc0508
This commit is contained in:
parent
89b5f5b1aa
commit
294fb5c3cd
|
|
@ -42,7 +42,8 @@ namespace Microsoft.AspNet.Razor.TagHelpers
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return string.Equals(descriptorX.AssemblyName, descriptorY.AssemblyName, StringComparison.Ordinal) &&
|
return descriptorX != null &&
|
||||||
|
string.Equals(descriptorX.AssemblyName, descriptorY.AssemblyName, StringComparison.Ordinal) &&
|
||||||
string.Equals(descriptorX.TypeName, descriptorY.TypeName, StringComparison.Ordinal);
|
string.Equals(descriptorX.TypeName, descriptorY.TypeName, StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,13 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
|
||||||
|
|
||||||
public bool Equals(IReadOnlyTagHelperAttribute attributeX, IReadOnlyTagHelperAttribute attributeY)
|
public bool Equals(IReadOnlyTagHelperAttribute attributeX, IReadOnlyTagHelperAttribute attributeY)
|
||||||
{
|
{
|
||||||
return
|
if (attributeX == attributeY)
|
||||||
attributeX == attributeY ||
|
{
|
||||||
// Normal comparer doesn't care about the Name case, in tests we do.
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Normal comparer (TagHelperAttribute.Equals()) doesn't care about the Name case, in tests we do.
|
||||||
|
return attributeX != null &&
|
||||||
string.Equals(attributeX.Name, attributeY.Name, StringComparison.Ordinal) &&
|
string.Equals(attributeX.Name, attributeY.Name, StringComparison.Ordinal) &&
|
||||||
Equals(attributeX.Value, attributeY.Value);
|
Equals(attributeX.Value, attributeY.Value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue