Skip to content

Commit

Permalink
Check for null afte FirstOrDefault (stevencohn#1308)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencohn authored and weissm committed Feb 19, 2024
1 parent 9c9cd08 commit 314179d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OneMore/Commands/Favorites/FavoritesProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ private async Task<bool> ConfirmByLocation(Favorite favorite)
var node = notebook;
for (int i = 1; i < parts.Length; i++)
{
node = node.Elements().FirstOrDefault(n => n.Attribute("name").Value == parts[i]);
node = node.Elements().FirstOrDefault(n => n.Attribute("name")?.Value == parts[i]);
if (node == null)
{
logger.WriteLine($"broken link to favorite parts[{i}] {favorite.Location}");
Expand Down

0 comments on commit 314179d

Please sign in to comment.