Skip to content

Commit d529a6c

Browse files
author
Warren Buckley
committed
Enable & fix up any nullable type issues
1 parent 2c0bb3f commit d529a6c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Our.Umbraco.TagHelpers/ActiveClassTagHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public ActiveClassTagHelper(IUmbracoContextAccessor umbracoContextAccessor)
3535
/// on an <a> tag when the page is active/selected
3636
/// </summary>
3737
[HtmlAttributeName(tagHelperAttributeName)]
38-
public string ActiveClassName { get; set; }
38+
public string? ActiveClassName { get; set; }
3939

4040

4141
/// <summary>
@@ -62,7 +62,7 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
6262

6363
// Try & parse href as URI, as it could be relative or absolute
6464
// or contain a quersystring we only want the path part
65-
if (Uri.TryCreate(href, UriKind.Absolute, out Uri link) || Uri.TryCreate(ctx.PublishedRequest.Uri, href, out link))
65+
if (Uri.TryCreate(href, UriKind.Absolute, out Uri? link) || Uri.TryCreate(ctx.PublishedRequest.Uri, href, out link))
6666
{
6767
// Get the node based of the value in the HREF
6868
var nodeOfLink = ctx.Content.GetByRoute(link.AbsolutePath);

Our.Umbraco.TagHelpers/Our.Umbraco.TagHelpers.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net5.0;net6.0;</TargetFrameworks>
55
</PropertyGroup>
66

77
<PropertyGroup>
@@ -29,6 +29,7 @@
2929
<PackageIcon>TagHelperLogo.png</PackageIcon>
3030
<PackageTags>Umbraco;TagHelper;TagHelpers;UmbracoCMS</PackageTags>
3131
<PackageReadmeFile>README.md</PackageReadmeFile>
32+
<Nullable>enable</Nullable>
3233
</PropertyGroup>
3334

3435
<ItemGroup>

0 commit comments

Comments
 (0)