Skip to content

Commit bc6df56

Browse files
author
Warren Buckley
authored
Merge pull request #42 from NikRimington/patch-1
Add null check on BackofficeUser access
2 parents 308c97c + 9ec990f commit bc6df56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Our.Umbraco.TagHelpers/EditLinkTagHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
5252

5353
// Check if the user is logged in to the backoffice
5454
// and they have access to the content section
55-
if (_backofficeUserAccessor.BackofficeUser.IsAllowedToSeeEditLink())
55+
if (_backofficeUserAccessor?.BackofficeUser != null && _backofficeUserAccessor.BackofficeUser.IsAllowedToSeeEditLink())
5656
{
5757
// Try & get Umbraco Current Node int ID (Only do this if ContentId has NOT been set)
5858
if (_umbracoContextAccessor.TryGetUmbracoContext(out var umbracoContext) && ContentId == int.MinValue)
@@ -150,4 +150,4 @@ private static string GetOuterElementStyles(
150150
return outerStyles.ToString();
151151
}
152152
}
153-
}
153+
}

0 commit comments

Comments
 (0)