Be defensive on comment text

This commit is contained in:
Alasdair Smith 2017-09-22 09:34:10 +01:00
parent c67150ea10
commit a0505afb23

View file

@ -106,7 +106,7 @@ module.exports = WebsocketController =
if options.encodeRanges
try
for comment in ranges?.comments or []
comment.op.c = encodeForWebsockets(comment.op.c)
comment.op.c = encodeForWebsockets(comment.op.c) if 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?