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

Template: Iteration with {{#each}} through an array containing null values bombs / throws exception #801

Closed
DanielDornhardt opened this issue Mar 12, 2013 · 0 comments

Comments

@DanielDornhardt
Copy link
Contributor

@DanielDornhardt DanielDornhardt commented Mar 12, 2013

This is the minimal example:

Template:

<template name="example">
    <ul>
        {{#each exampleList}}
            <li>{{this}}</li>
        {{/each}}
    </ul>
</template>

JS:

Works:

Template.example.exampleList = function() {
    return ['one', 'two', 'three'];
};

Breaks:

Template.example.exampleList = function() {
    return ['one', 'two', 'three', null];
};

The error in the browser reads:

Uncaught TypeError: Cannot read property '_id' of null 
Exception from Meteor.flush: TypeError: Cannot call method 'firstNode' of undefined

(A little bit more) Discussion here:

https://groups.google.com/forum/?fromgroups=#!searchin/meteor-talk/bombs/meteor-talk/a6CllgeoHOo/L3IjREyf0egJ

@raix raix mentioned this issue Mar 15, 2013
@cmather cmather closed this Mar 15, 2013
sdarnell referenced this issue in sdarnell/meteor-win Apr 7, 2013
sdarnell referenced this issue in sdarnell/meteor-win Apr 7, 2013
martijnwalraven pushed a commit that referenced this issue Feb 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.