loleaflet/src/layer/tile/CalcTileLayer.js |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit d559471fab916377eb38fdfbc78735214df2a3b7
Author: Pranav Kant <pran...@collabora.co.uk>
Date:   Thu Apr 6 16:59:44 2017 +0530

    loleaflet: Exit early for invalid commandvalues
    
    LO core doesn't output any change tracking information for spreadsheets
    which results in sending an empty 'commandvalues: ' message to
    loleaflet. While the actual fix for it would go in LO core, lets handle
    this empty case for now in loleaflet, so that we don't throw any runtime
    JS exceptions.
    
    Change-Id: Id2b66b8e7f1c87b074d3e72168e0ca3c3c0d345d

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 1fa97c45..9fba31fc 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -417,7 +417,11 @@ L.CalcTileLayer = L.TileLayer.extend({
        },
 
        _onCommandValuesMsg: function (textMsg) {
-               var values = 
JSON.parse(textMsg.substring(textMsg.indexOf('{')));
+               var jsonIdx = textMsg.indexOf('{');
+               if (jsonIdx === -1)
+                       return;
+
+               var values = JSON.parse(textMsg.substring(jsonIdx));
                if (!values) {
                        return;
                }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to