Refactor SimilarNodeName to account for null nodeName values.
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
var name = Name;
|
||||
|
||||
// cater for instances where node has no name.
|
||||
if(name.Length == 0)
|
||||
if(string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
return _numPos;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
}
|
||||
}
|
||||
|
||||
return uniqueing ? string.Concat(nodeName, " (", uniqueNumber.ToString(), ")") : nodeName;
|
||||
return uniqueing || string.IsNullOrWhiteSpace(nodeName) ? string.Concat(nodeName, " (", uniqueNumber.ToString(), ")") : nodeName;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user