From 1ea1cd612a3a51cfeb73336c7b80d15097a66bb8 Mon Sep 17 00:00:00 2001 From: Tim Needham Date: Sun, 17 Jan 2016 14:42:38 +0000 Subject: [PATCH] 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] --- lib/model.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/model.js b/lib/model.js index f3ec47b2..d6564bf4 100644 --- a/lib/model.js +++ b/lib/model.js @@ -806,8 +806,8 @@ module.exports = function(registry) { listenerTree.before = listenerTree.before || {}; listenerTree.after = listenerTree.after || {}; - var beforeListeners = remotes.listenerTree.before[toModelName] || {}; - var afterListeners = remotes.listenerTree.after[toModelName] || {}; + var beforeListeners = listenerTree.before[toModelName] || {}; + var afterListeners = listenerTree.after[toModelName] || {}; sharedClass.methods().forEach(function(method) { var delegateTo = method.rest && method.rest.delegateTo;