editor: Prevent JS errors if no polyline has been drawn yet

This commit is contained in:
Markus Koch 2020-04-19 09:14:19 +02:00
parent 354ca8d1d7
commit 1a2f9908fa
1 changed files with 2 additions and 0 deletions

View File

@ -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++) {