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

View File

@ -28,6 +28,8 @@ if (editor_mode) {
} }
function onDragEnd(e) { function onDragEnd(e) {
if (!polyline)
return;
var latlngs = polyline.getLatLngs(); var latlngs = polyline.getLatLngs();
for (var i = 0; i < latlngs.length; i++) { for (var i = 0; i < latlngs.length; i++) {