Fix typo in Model.nestRemoting

Prevent apps from crashing when using `Model.nestRemoting` without
`{ hooks: false }` option.

Note that it is not possible to reproduce this bug using our current
Mocha test suite, because other tests modify the global state in such
way that the bug no longer occurs.

[back-port of #2245]
This commit is contained in:
Tim Needham 2016-01-17 14:42:38 +00:00 committed by Miroslav Bajtoš
parent 4678cb4b7c
commit 1ea1cd612a
1 changed files with 2 additions and 2 deletions

View File

@ -806,8 +806,8 @@ module.exports = function(registry) {
listenerTree.before = listenerTree.before || {}; listenerTree.before = listenerTree.before || {};
listenerTree.after = listenerTree.after || {}; listenerTree.after = listenerTree.after || {};
var beforeListeners = remotes.listenerTree.before[toModelName] || {}; var beforeListeners = listenerTree.before[toModelName] || {};
var afterListeners = remotes.listenerTree.after[toModelName] || {}; var afterListeners = listenerTree.after[toModelName] || {};
sharedClass.methods().forEach(function(method) { sharedClass.methods().forEach(function(method) {
var delegateTo = method.rest && method.rest.delegateTo; var delegateTo = method.rest && method.rest.delegateTo;