[Libreoffice-commits] online.git: loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Mar 26 14:24:37 UTC 2019


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

New commits:
commit fe702b1d11ca4fecc10eef5e9346689c1804b440
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 20 09:34:19 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Mar 26 15:24:08 2019 +0100

    Avoid syntax errors while paring command results
    
    Change-Id: I7d778fd62aeb32c8304afb90c21aafd83379c170

diff --git a/loleaflet/src/layer/tile/WriterTileLayer.js b/loleaflet/src/layer/tile/WriterTileLayer.js
index 9883b7e81..727711027 100644
--- a/loleaflet/src/layer/tile/WriterTileLayer.js
+++ b/loleaflet/src/layer/tile/WriterTileLayer.js
@@ -182,7 +182,12 @@ L.WriterTileLayer = L.TileLayer.extend({
 	},
 
 	_onCommandValuesMsg: function (textMsg) {
-		var values = JSON.parse(textMsg.substring(textMsg.indexOf('{')));
+		var braceIndex = textMsg.indexOf('{');
+		if (braceIndex < 0) {
+			return;
+		}
+
+		var values = JSON.parse(textMsg.substring(braceIndex));
 		if (!values) {
 			return;
 		}


More information about the Libreoffice-commits mailing list