Skip to content

Commit

Permalink
From v13: Fixes (#590) - missing null check
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinJump committed Apr 17, 2024
1 parent 25fce62 commit 4aacf2e
Show file tree
Hide file tree
Showing 2 changed files with 2,179 additions and 2,167 deletions.
12 changes: 11 additions & 1 deletion uSync.BackOffice/Extensions/uSyncActionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;

using Umbraco.Extensions;
Expand Down Expand Up @@ -61,4 +62,13 @@ public static IEnumerable<uSyncAction> ConvertToSummary(this IEnumerable<uSyncAc
return summary;
}

/// <summary>
/// try to find an action in the list based on key, and handler alias
/// </summary>
public static bool TryFindAction(this IEnumerable<uSyncAction> actions, Guid key, string handlerAlias, out uSyncAction action)
{
action = actions.FirstOrDefault(x => $"{x.key}_{x.HandlerAlias}" == $"{key}_{handlerAlias}", new uSyncAction { key = Guid.Empty });
return action.key != Guid.Empty;
}

}
Loading

0 comments on commit 4aacf2e

Please sign in to comment.