richard-scryber / scryber.core

Scryber.Core is a dotnet 6 html to pdf engine written entirely in C# for creating beautiful flowing documents from html templates including css styles, object data binding and svg drawing.
Other
194 stars 31 forks source link

Object Null Exception if rel is not set on stylesheet link #42

Closed richard-scryber closed 3 years ago

richard-scryber commented 3 years ago
<link href='./HTML/CSS/HelloPrint.css' 
            media='print' />

Will throw a really bad object reference not set to an instance of object.

<link rel='stylesheet'
            href='./HTML/CSS/HelloPrint.css' 
            media='print' />

Works

richard-scryber commented 3 years ago

The 'rel'ationship attribute is required. Update the exception to be more descriptive, rather than assume it is a stylesheet.

richard-scryber commented 3 years ago

Fixed in 5.0.6.3 to log an error, or raise an exception if we are in strict conformance mode.