ligershark / WebOptimizer

A bundler and minifier for ASP.NET Core
Apache License 2.0
753 stars 113 forks source link

Fix LinkTagHelper crash when renderin inline styles #260

Closed Elimi81 closed 1 year ago

Elimi81 commented 1 year ago

LinkTagHelper should not handle link-tag with inline-attribute and the check for the attribute is too late in the code resulting in an exception because "href"-variable becomes null:

System.NullReferenceException: Object reference not set to an instance of an object. at WebOptimizer.Taghelpers.LinkTagHelper.Process(TagHelperContext context, TagHelperOutput output) in ...\WebOptimizer\src\WebOptimizer.Core\Taghelpers\LinkTagHelper.cs:line 51

Checking the inline-attribute earlier fixed this.

madskristensen commented 1 year ago

Thanks