wycats/handlebars.js — Issue #142: Array of Objects: TypeError: Cannot read property 'id' of undefined
Author: wilsolutions
Created: 2011-11-21 17:23:11+00:00
State: open

Hi,

I have a list of items and each item can have a Photo item or not.

I'm looping using "this"

It is fine when all items have a Photo:

when the current object do not have a Photo object.
TypeError: Cannot read property 'id' of undefined

Format of my objects:
[
Object
Item: Object
Photo: Array[1]
Rating: Array[0]
Tag: Array[0]
__proto__: Object
,
Object
Item: Object
Photo: Array[0]
Rating: Array[0]
Tag: Array[0]
__proto__: Object
,
Object
,
Object
,
Object
]

The second Object do not have a Photo record all the other ones have.