Skip to content

Commit 136a4ed

Browse files
author
Warren Buckley
committed
LangSwitcher Nullable fixes
1 parent 689c2ba commit 136a4ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Our.Umbraco.TagHelpers/LanguageSwitcherTagHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public override async Task ProcessAsync(TagHelperContext context, TagHelperOutpu
5252
var allDomains = umbracoContext.Domains.GetAll(false);
5353
var allDomainsFiltered = allDomains?.GroupBy(d => d.Culture).Select(g => g.First()).ToList();
5454

55-
if (allDomainsFiltered.Count() > 0)
55+
if (allDomainsFiltered?.Count() > 0)
5656
{
5757
// List of languages/model to use with
5858
var data = new Dictionary<string, object>();
@@ -99,11 +99,11 @@ public override async Task ProcessAsync(TagHelperContext context, TagHelperOutpu
9999

100100
public class LanguageSwitcherLang
101101
{
102-
public string Culture { get; set; }
102+
public string? Culture { get; set; }
103103

104-
public string Name { get; set; }
104+
public string? Name { get; set; }
105105

106-
public string Url { get; set; }
106+
public string? Url { get; set; }
107107

108108
public bool IsCurrentLang { get; set; }
109109
}

0 commit comments

Comments
 (0)