From 1a2f9908fac4917abdb54ef0c52dcf702a140ba2 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Sun, 19 Apr 2020 09:14:19 +0200 Subject: editor: Prevent JS errors if no polyline has been drawn yet --- htdocs/streeteditor.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/streeteditor.js b/htdocs/streeteditor.js index 8b86a4a..27addb5 100644 --- a/htdocs/streeteditor.js +++ b/htdocs/streeteditor.js @@ -28,6 +28,8 @@ if (editor_mode) { } function onDragEnd(e) { + if (!polyline) + return; var latlngs = polyline.getLatLngs(); for (var i = 0; i < latlngs.length; i++) { -- cgit v1.2.3