Adds null check and adds back orig ctor for ProfilingLogger
This commit is contained in:
@@ -45,7 +45,11 @@ namespace Umbraco.Cms.Core.Composing
|
||||
return _discovered;
|
||||
}
|
||||
|
||||
IEnumerable<string> additionalTargetAssemblies = _additionalTargetAssemblies.Concat(Constants.Composing.UmbracoCoreAssemblyNames);
|
||||
IEnumerable<string> additionalTargetAssemblies = Constants.Composing.UmbracoCoreAssemblyNames;
|
||||
if (_additionalTargetAssemblies != null)
|
||||
{
|
||||
additionalTargetAssemblies = additionalTargetAssemblies.Concat(_additionalTargetAssemblies);
|
||||
}
|
||||
|
||||
var finder = new FindAssembliesWithReferencesTo(new[] { _entryPointAssembly }, additionalTargetAssemblies.ToArray(), true, _loggerFactory);
|
||||
_discovered = finder.Find().ToList();
|
||||
|
||||
@@ -18,6 +18,15 @@ namespace Umbraco.Cms.Core.Logging
|
||||
/// </summary>
|
||||
public IProfiler Profiler { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ProfilingLogger"/> class.
|
||||
/// </summary>
|
||||
public ProfilingLogger(ILogger<ProfilingLogger> logger, IProfiler profiler)
|
||||
{
|
||||
Logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
Profiler = profiler ?? throw new ArgumentNullException(nameof(profiler));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ProfilingLogger"/> class.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text.RegularExpressions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Umbraco.Cms.Core.Configuration.Models;
|
||||
@@ -17,7 +17,7 @@ namespace Umbraco.Cms.Core.Templates
|
||||
private static readonly Regex ResolveUrlPattern = new Regex("(=[\"\']?)(\\W?\\~(?:.(?![\"\']?\\s+(?:\\S+)=|[>\"\']))+.)[\"\']?",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
|
||||
|
||||
public HtmlUrlParser(IOptions<ContentSettings> contentSettings, ILogger<HtmlUrlParser> logger ,IProfilingLogger profilingLogger, IIOHelper ioHelper)
|
||||
public HtmlUrlParser(IOptions<ContentSettings> contentSettings, ILogger<HtmlUrlParser> logger, IProfilingLogger profilingLogger, IIOHelper ioHelper)
|
||||
{
|
||||
_contentSettings = contentSettings.Value;
|
||||
_logger = logger;
|
||||
@@ -36,7 +36,8 @@ namespace Umbraco.Cms.Core.Templates
|
||||
/// </remarks>
|
||||
public string EnsureUrls(string text)
|
||||
{
|
||||
if (_contentSettings.ResolveUrlsFromTextString == false) return text;
|
||||
if (_contentSettings.ResolveUrlsFromTextString == false)
|
||||
return text;
|
||||
|
||||
using (var timer = _profilingLogger.DebugDuration(typeof(IOHelper), "ResolveUrlsFromTextString starting", "ResolveUrlsFromTextString complete"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user