Removed usage of obsoleted ArgumentNullOrEmptyException

This commit is contained in:
Ronald Barendse
2019-10-07 22:10:21 +02:00
parent 8920e10a94
commit ed90e71f76
43 changed files with 394 additions and 307 deletions

View File

@@ -10,9 +10,7 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Web.Security;
using Newtonsoft.Json;
using Umbraco.Core.Configuration;
using Umbraco.Core.Composing;
using Umbraco.Core.Exceptions;
using Umbraco.Core.IO;
using Umbraco.Core.Strings;
@@ -1102,7 +1100,8 @@ namespace Umbraco.Core
/// <returns>The safe url segment.</returns>
public static string ToUrlSegment(this string text)
{
if (string.IsNullOrWhiteSpace(text)) throw new ArgumentNullOrEmptyException(nameof(text));
if (text == null) throw new ArgumentNullException(nameof(text));
if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(text));
return Current.ShortStringHelper.CleanStringForUrlSegment(text);
}
@@ -1115,7 +1114,8 @@ namespace Umbraco.Core
/// <returns>The safe url segment.</returns>
public static string ToUrlSegment(this string text, string culture)
{
if (string.IsNullOrWhiteSpace(text)) throw new ArgumentNullOrEmptyException(nameof(text));
if (text == null) throw new ArgumentNullException(nameof(text));
if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(text));
return Current.ShortStringHelper.CleanStringForUrlSegment(text, culture);
}