Fixes tests, ensures we null check when generating hashes for items in a collection

This commit is contained in:
Shannon
2017-04-30 19:14:36 +10:00
parent ea14170272
commit d64fa7f92d
3 changed files with 8 additions and 2 deletions
+3
View File
@@ -44,6 +44,7 @@ namespace Umbraco.Core
int hash = 0;
foreach (var item in list)
{
if (item == null) continue;
hash = 31 * hash + item.GetHashCode();
}
return hash;
@@ -57,6 +58,7 @@ namespace Umbraco.Core
int hash = 0;
foreach (var item in list)
{
if (item == null) continue;
hash = 31 * hash + item.GetHashCode();
}
return hash;
@@ -77,6 +79,7 @@ namespace Umbraco.Core
int count = 0;
foreach (var item in list)
{
if (item == null) continue;
hash += item.GetHashCode();
count++;
}