When saving, the post save handler in index.js fails when trying to populate the Card references on this.get(options.path) (line 64) as the path 'state.cards.card' is undefined. I think before getting the length of the object, it should check that it exists.
I'm using version 0.12.0 of the plugin and mongoose 5.9.4.
Populating a document after an update through .save() fails with
TypeError: Cannot read property 'length' of undefined.
I have a Schema like this:
And a document I'm fetching and updating by pushing a new value to the players array, while state is an empty array. Before saving it looks like this:
When saving, the post save handler in index.js fails when trying to populate the Card references on
this.get(options.path)
(line 64) as the path'state.cards.card'
is undefined. I think before getting the length of the object, it should check that it exists.I'm using version 0.12.0 of the plugin and mongoose 5.9.4.