asciidisco / Backbone.Mutators

Backbone plugin to override getters and setters with logic
http://asciidisco.github.com/Backbone.Mutators
228 stars 30 forks source link

Using w/ Require AMD - this.mutators is undefined throws Type Error - Line 169 #11

Closed AndrewHenderson closed 11 years ago

AndrewHenderson commented 11 years ago

When passing Mutators.js as a dependency on a model that did not have any mutators defined, a type error is thrown. Cannot read property 'forEach' of undefined - Line 169. This caused the entire app to break.

Adding a simple if statement resolved this. I will submit a pull request to help avoid this user error and allow the app to build as normal.