A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/lunet-io/scriban/issues/120 below:

Template.ParseLiquid throws NullReferenceException · Issue #120 · scriban/scriban · GitHub

Template.ParseLiquid can sometimes throw NullReferenceException instead of storing error details in the resulting template. Here's the full program that reproduces this:

namespace Scriban.Run
{
  public class Program
  {
    public static void Main(string[] args)
    {
      Template.ParseLiquid("{%endunless");
    }
  }
}

And here's the full stack trace:

Exception has occurred: CLR/System.NullReferenceException
An unhandled exception of type 'System.NullReferenceException' occurred in Scriban.dll: 'Object reference not set to an instance of an object.'
   at Scriban.Parsing.Parser.ExpectEndOfStatement(ScriptStatement statement)
   at Scriban.Parsing.Parser.ParseLiquidStatement(String identifier, ScriptStatement parent, ScriptStatement& statement, Boolean& hasEnd, Boolean& nextStatement)
   at Scriban.Parsing.Parser.TryParseStatement(ScriptStatement parent, ScriptStatement& statement, Boolean& hasEnd)
   at Scriban.Parsing.Parser.ParseBlockStatement(ScriptStatement parentStatement)
   at Scriban.Parsing.Parser.Run()
   at Scriban.Template.ParseInternal(String text, String sourceFilePath)
   at Scriban.Template.ParseLiquid(String text, String sourceFilePath, Nullable`1 parserOptions, Nullable`1 lexerOptions)

I'm using .NET Core 2.2 and the latest NuGet alpha version of Scriban (2.0.0-alpha-005).

Found via SharpFuzz.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4