diff --git a/src/Umbraco.Core/Packaging/InstallationSummary.cs b/src/Umbraco.Core/Packaging/InstallationSummary.cs index 22818f352c..2aa74474d1 100644 --- a/src/Umbraco.Core/Packaging/InstallationSummary.cs +++ b/src/Umbraco.Core/Packaging/InstallationSummary.cs @@ -39,8 +39,8 @@ namespace Umbraco.Cms.Core.Packaging void WriteConflicts(IEnumerable source, Func selector, string message, bool appendLine = true) { - var result = source.Select(selector).ToList(); - if (result.Count > 0) + var result = source?.Select(selector).ToList(); + if (result?.Count > 0) { sb.Append(message); sb.Append(string.Join(", ", result)); @@ -55,7 +55,7 @@ namespace Umbraco.Cms.Core.Packaging void WriteCount(string message, IEnumerable source, bool appendLine = true) { sb.Append(message); - sb.Append(source.Count()); + sb.Append(source?.Count() ?? 0); if (appendLine) { @@ -63,9 +63,9 @@ namespace Umbraco.Cms.Core.Packaging } } - WriteConflicts(Warnings.ConflictingMacros, x => x.Alias, "Conflicting macros found, they will be overwritten: "); - WriteConflicts(Warnings.ConflictingTemplates, x => x.Alias, "Conflicting templates found, they will be overwritten: "); - WriteConflicts(Warnings.ConflictingStylesheets, x => x.Alias, "Conflicting stylesheets found, they will be overwritten: "); + WriteConflicts(Warnings?.ConflictingMacros, x => x.Alias, "Conflicting macros found, they will be overwritten: "); + WriteConflicts(Warnings?.ConflictingTemplates, x => x.Alias, "Conflicting templates found, they will be overwritten: "); + WriteConflicts(Warnings?.ConflictingStylesheets, x => x.Alias, "Conflicting stylesheets found, they will be overwritten: "); WriteCount("Data types installed: ", DataTypesInstalled); WriteCount("Languages installed: ", LanguagesInstalled); WriteCount("Dictionary items installed: ", DictionaryItemsInstalled);