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

Calling partial that returns value without arguments (or a zero argument) just silently fails #7572

Closed
bep opened this issue Aug 19, 2020 · 2 comments
Assignees
Milestone

Comments

@bep
Copy link
Member

bep commented Aug 19, 2020

No description provided.

@bep bep added the Bug label Aug 19, 2020
@bep bep added this to the v0.75 milestone Aug 19, 2020
@bep bep self-assigned this Aug 19, 2020
@bep bep changed the title Calling partial without arguments just silently fails Calling partial that returns value without arguments just silently fails Aug 19, 2020
@bep bep changed the title Calling partial that returns value without arguments just silently fails Calling partial that returns value without arguments (or a zero argument) just silently fails Aug 19, 2020
@bep bep closed this as completed in ae63c2b Aug 19, 2020
@ericselin
Copy link
Contributor

I get that this is was a bug in the expected behavior. However, this fix broke my particular use case:

{{ with partial "helpers/get-image" .image }}
  <!-- do something with image if found -->
{{ end }}

In my case .image may be empty, and in this case it is completely correct to silently "fail" and return nil from the partial.

Just my five cents: maybe better to make a warning out of similar cases as opposed to a full error, so current behavior is not broken?

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants