Protect menu item comparer from null route values

Prevents a null ysod in rare cases

--HG--
branch : dev
This commit is contained in:
Louis DeJardin
2010-07-27 15:42:29 -07:00
parent 9bd16e9fe6
commit 16b2b37531

View File

@@ -40,7 +40,12 @@ namespace Orchard.UI.Navigation {
}
if (obj.RouteValues != null) {
foreach (var item in obj.RouteValues) {
hash ^= item.Key.GetHashCode() ^ item.Value.GetHashCode();
if (item.Key != null) {
hash ^= item.Key.GetHashCode();
}
if (item.Value != null) {
hash ^= item.Value.GetHashCode();
}
}
}
return hash;