From c67150ea10334f5ab57445a6f1b31b852d5750cf Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 22 Sep 2017 09:33:29 +0100 Subject: [PATCH] Ensure falsy value doesn't fail conditional --- services/real-time/app/coffee/WebsocketController.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/real-time/app/coffee/WebsocketController.coffee b/services/real-time/app/coffee/WebsocketController.coffee index 580e8ac20b..63c3ff903a 100644 --- a/services/real-time/app/coffee/WebsocketController.coffee +++ b/services/real-time/app/coffee/WebsocketController.coffee @@ -108,8 +108,8 @@ module.exports = WebsocketController = for comment in ranges?.comments or [] comment.op.c = encodeForWebsockets(comment.op.c) for change in ranges?.changes or [] - change.op.i = encodeForWebsockets(change.op.i) if change.op.i - change.op.d = encodeForWebsockets(change.op.d) if change.op.d + change.op.i = encodeForWebsockets(change.op.i) if change.op.i? + change.op.d = encodeForWebsockets(change.op.d) if change.op.d? catch err logger.err {err, project_id, doc_id, fromVersion, ranges, client_id: client.id}, "error encoding range uri component" return callback(err)