loleaflet/src/layer/vector/SVGGroup.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
New commits: commit f287b599bcd7497e4be65967ae2efa4db5e2253b Author: Tor Lillqvist <t...@collabora.com> AuthorDate: Wed Jul 31 18:54:04 2019 +0300 Commit: Tor Lillqvist <t...@collabora.com> CommitDate: Tue Aug 20 10:53:43 2019 +0200 Guard against uncaught exception Change-Id: I0ebae5f7dbf07e81d7b09f5c98506e85a6a52e93 Reviewed-on: https://gerrit.libreoffice.org/76761 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tor Lillqvist <t...@collabora.com> (cherry picked from commit 40285fa45d1019613bfc86d9aa5ca7702e9ba14f) Reviewed-on: https://gerrit.libreoffice.org/77786 Tested-by: Tor Lillqvist <t...@collabora.com> diff --git a/loleaflet/src/layer/vector/SVGGroup.js b/loleaflet/src/layer/vector/SVGGroup.js index 48a1e5967..7f0f8678a 100644 --- a/loleaflet/src/layer/vector/SVGGroup.js +++ b/loleaflet/src/layer/vector/SVGGroup.js @@ -59,6 +59,10 @@ L.SVGGroup = L.Layer.extend({ if (!this._dragShape || !this.dragging) return; + + if (!this._map) + return; + this._moved = false; L.DomEvent.on(this._dragShape, 'mousemove', this._onDrag, this); @@ -87,6 +91,9 @@ L.SVGGroup = L.Layer.extend({ if (!this._dragShape || !this.dragging) return; + if (!this._map) + return; + if (!this._moved) { this._moved = true; this._showEmbeddedSVG(); @@ -114,8 +121,11 @@ L.SVGGroup = L.Layer.extend({ this._moved = false; this._hideEmbeddedSVG(); - var pos = this._map.mouseEventToLatLng(evt); - this.fire('graphicmoveend', {pos: pos}); + + if (this._map) { + var pos = this._map.mouseEventToLatLng(evt); + this.fire('graphicmoveend', {pos: pos}); + } if (evt.type === 'mouseup') this.dragging._onDragEnd(evt); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits