josephg / ShareJS

Collaborative editing in any app
Other
4.97k stars 454 forks source link

add null check #386

Closed jonsadka closed 9 years ago

jonsadka commented 9 years ago

Add null check prior to sending the op to prevent undefined operations from being sent. I ran into an instance where the op was undefined, causing Session.prototype._sendOp to error.

Session.prototype._sendOp = function(collection, docName, data) {
  var msg = {
    a: 'op',
    c: collection,
    d: docName,
    v: data.v,
    src: data.src,
    seq: data.seq
  };
nateps commented 9 years ago

doing this separately with log