Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V15: Adding not null when annotation #17379

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Navigation;
using Umbraco.Cms.Core.Persistence.Repositories;
Expand Down Expand Up @@ -64,11 +65,10 @@ public bool TryGetAncestorsKeysInBin(Guid childKey, out IEnumerable<Guid> ancest
public bool TryGetSiblingsKeysInBin(Guid key, out IEnumerable<Guid> siblingsKeys)
=> TryGetSiblingsKeysFromStructure(_recycleBinNavigationStructure, key, out siblingsKeys);

public bool TryGetLevel(Guid contentKey, out int? level)
public bool TryGetLevel(Guid contentKey, [NotNullWhen(true)] out int? level)
{
level = 1;
Guid? parentKey;
if (TryGetParentKey(contentKey, out parentKey) is false)
if (TryGetParentKey(contentKey, out Guid? parentKey) is false)
{
level = null;
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using Umbraco.Extensions;

namespace Umbraco.Cms.Core.Services.Navigation;
Expand Down Expand Up @@ -44,5 +45,5 @@ bool TryGetAncestorsOrSelfKeys(Guid childKey, out IEnumerable<Guid> ancestorsOrS

bool TryGetSiblingsKeys(Guid key, out IEnumerable<Guid> siblingsKeys);

bool TryGetLevel(Guid contentKey, out int? level);
bool TryGetLevel(Guid contentKey, [NotNullWhen(true)] out int? level);
}
Loading