You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g., AngleSharp.Css for CSS support)
Did you perform a search in the issues?
For more information, see the CONTRIBUTING guide.
Description
Calling CssParser.ParseStyleSheetAsync("") throws a System.NullReferenceException.
Steps to Reproduce
Code:
class Program
{
static async Task Main(string[] args)
{
var parser = new CssParser();
var s = await parser.ParseStyleSheetAsync("");
Console.WriteLine(s);
}
}
Stacktrace:
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at AngleSharp.Text.TextSource.DetectByteOrderMarkAsync(CancellationToken cancellationToken)
at AngleSharp.Text.TextSource.PrefetchAllAsync(CancellationToken cancellationToken)
at AngleSharp.Css.Parser.CssParser.ParseStyleSheetAsync(String content, CancellationToken cancelToken)
Expected behavior: [What you expected to happen]
To behave like the non-async version which correctly parses the empty string and returns an empty stylesheet.
Uh oh!
There was an error while loading. Please reload this page.
Bug Report
Prerequisites
AngleSharp.Css
for CSS support)For more information, see the
CONTRIBUTING
guide.Description
Calling CssParser.ParseStyleSheetAsync("") throws a System.NullReferenceException.
Steps to Reproduce
Code:
Stacktrace:
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at AngleSharp.Text.TextSource.DetectByteOrderMarkAsync(CancellationToken cancellationToken)
at AngleSharp.Text.TextSource.PrefetchAllAsync(CancellationToken cancellationToken)
at AngleSharp.Css.Parser.CssParser.ParseStyleSheetAsync(String content, CancellationToken cancelToken)
Expected behavior: [What you expected to happen]
To behave like the non-async version which correctly parses the empty string and returns an empty stylesheet.
Environment details: [OS, .NET Runtime, ...]
Windows 10
.NET Core 3.0.100
The text was updated successfully, but these errors were encountered: