Skip to content

Commit

Permalink
Merge pull request #160 from meziantou/fix-nre
Browse files Browse the repository at this point in the history
Fix NullReferenceException in ChangeDeclarations
  • Loading branch information
FlorianRappl authored Feb 26, 2024
2 parents 0652a66 + b36924d commit c1c83ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/AngleSharp.Css/Dom/Internal/CssStyleDeclaration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ private void RemovePropertyByName(String propertyName)

private void ChangeDeclarations(IEnumerable<ICssProperty> decls, Predicate<ICssProperty> defaultSkip, Func<ICssProperty, ICssProperty, Boolean> removeExisting)
{
if (decls is null)
{
return;
}

var declarations = new List<ICssProperty>();

foreach (var newdecl in decls)
Expand Down

0 comments on commit c1c83ee

Please sign in to comment.