Skip to content

Commit

Permalink
Update source
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanMagnan committed Feb 4, 2022
1 parent d0dbd83 commit c515e20
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/HtmlAgilityPack.Shared/HtmlAttributeCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,18 @@ public void Insert(int index, HtmlAttribute item)
/// <returns></returns>
bool ICollection<HtmlAttribute>.Remove(HtmlAttribute item)
{
Remove(item);
if (item == null)
{
return false;
}

int index = GetAttributeIndex(item);
if (index == -1)
{
return false;
}

RemoveAt(index);
return true;
}

Expand Down

0 comments on commit c515e20

Please sign in to comment.