From 8a6a22c7676113ed1067ea80004ddefab29b740a Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Sun, 19 Mar 2017 12:39:33 -0700 Subject: [PATCH] Fix one of Taylor's broken comparers This was a bug that wasn't being caught by tests until I implemented IEquatable on the TagHelper types. --- .../TagHelperDescriptorComparer.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/TagHelperDescriptorComparer.cs b/src/Microsoft.AspNetCore.Razor.Evolution/TagHelperDescriptorComparer.cs index 44f5e856af..567ee41841 100644 --- a/src/Microsoft.AspNetCore.Razor.Evolution/TagHelperDescriptorComparer.cs +++ b/src/Microsoft.AspNetCore.Razor.Evolution/TagHelperDescriptorComparer.cs @@ -51,6 +51,11 @@ namespace Microsoft.AspNetCore.Razor.Evolution return true; } + if (descriptorX == null ^ descriptorY == null) + { + return false; + } + return descriptorX != null && string.Equals(descriptorX.Kind, descriptorY.Kind, StringComparison.Ordinal) && string.Equals(descriptorX.AssemblyName, descriptorY.AssemblyName, StringComparison.Ordinal) &&