diff --git a/packages/livedata/livedata_server.js b/packages/livedata/livedata_server.js index 85ff32e7e9..799ce6bd06 100644 --- a/packages/livedata/livedata_server.js +++ b/packages/livedata/livedata_server.js @@ -440,10 +440,14 @@ _.extend(Meteor._LivedataSession.prototype, { var res = handler.apply(sub, params || []); - // automatically wire up handlers that return a Cursor. - // otherwise, the handler is completely responsible for delivering - // its own data messages and registering stop functions. - if (res instanceof _Mongo.Cursor) // XXX generalize + // if Meteor._RemoteCollectionDriver is available (defined in + // mongo-livedata), automatically wire up handlers that return a + // Cursor. otherwise, the handler is completely responsible for + // delivering its own data messages and registering stop + // functions. + // + // XXX generalize + if (Meteor._RemoteCollectionDriver && (res instanceof Meteor._Mongo.Cursor)) sub._publishCursor(res); },