Block helper "with" should check for empty context #213

Merged
merged 1 commit into from Mar 14, 2013

Projects

None yet

4 participants

@thejohnfreeman
Contributor

Add a simple check to the 'with' block helper for an empty context. I think the behavior - no output with an empty context - is unsurprising at worst, expected at best, and will prevent "cannot read property of undefined" errors.

@wagenet
Collaborator
wagenet commented May 25, 2012

@thejohnfreeman Do you get the same error if you do {{notPresent.someProp}}?

@kpdecker
Collaborator

@thejohnfreeman Do you have a test case or jsfiddle that demonstrates the situation this is trying to prevent?

@thejohnfreeman
Contributor

If I return to the project that generated this bug, sure, but I don't know when that will be (if ever).

@kpdecker kpdecker merged commit 2197763 into wycats:master Mar 14, 2013
@ericf
ericf commented on 0872fb6 May 15, 2013

@thejohnfreeman can you explain why this change was made? See #518

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment