Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Includes tag fails with error. "Liquid error: Value cannot be null." #31

Closed
vistaCentreB2 opened this issue Mar 30, 2011 · 3 comments
Closed

Comments

@vistaCentreB2
Copy link

I have a directory: C:\temp\templates
With the files: test.liquid and _myInclude.liquid

test.liquid has the following:
{% include myInclude %}

and _myInclude.liquid has:
Hello World!

My code looks like this:
string path = @"C:\temp\templates\test.liquid";
string dir = Path.GetDirectoryName(path);
var fs = new LocalFileSystem(dir);
Template.FileSystem = fs;

string templateContents = File.ReadAllText(path);
Template template = Template.Parse(templateContents);

string result = template.Render();  

And from that I get the following error:
Liquid error: Value cannot be null. Parameter name: input
Occurs in LocalFileSystem.cs, FullPath(string), line 40

@petrhaus
Copy link
Member

it should be {% include '_myInclude' %}

@vistaCentreB2
Copy link
Author

Yes, that works. I was confused by the error message, thanks.

@tgjones
Copy link
Contributor

tgjones commented Apr 5, 2011

Thanks for logging this - the error message was "wrong" because we were not properly handling missing / null templates. My latest commit (f6d8431) fixes this, so the error message is clearer.

@tgjones tgjones closed this as completed Apr 5, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants