From 1bc10345432aa1858867228ecb57b46c1ccbde1c Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 13 Feb 2020 04:25:36 +0000 Subject: [PATCH] Avoid exception dragging during shutdown. Really TileLayer.js should have a clean on remove that dis-connects from drag, resize etc. but it doesn't yet. Change-Id: Ia2c2268875187a2f1115b7d357fd56ab825bb77f Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88578 Reviewed-by: Michael Meeks Tested-by: Ashod Nakashian --- loleaflet/src/layer/tile/GridLayer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js index a69741462..9a9d7f004 100644 --- a/loleaflet/src/layer/tile/GridLayer.js +++ b/loleaflet/src/layer/tile/GridLayer.js @@ -446,6 +446,7 @@ L.GridLayer = L.Layer.extend({ }, _updateScrollOffset: function () { + if (!this._map) return; var centerPixel = this._map.project(this._map.getCenter()); var newScrollPos = centerPixel.subtract(this._map.getSize().divideBy(2)); var x = Math.round(newScrollPos.x < 0 ? 0 : newScrollPos.x);