diff --git a/src/dom/Draggable.js b/src/dom/Draggable.js index 59362978..48bb6cb0 100644 --- a/src/dom/Draggable.js +++ b/src/dom/Draggable.js @@ -62,7 +62,7 @@ L.Draggable = L.Class.extend({ el = first.target; // if touching a link, highlight it - if (L.Browser.touch && el.tagName.toLowerCase() === 'a') { + if (L.Browser.touch && el.tagName && el.tagName.toLowerCase() === 'a') { L.DomUtil.addClass(el, 'leaflet-active'); } diff --git a/src/map/handler/Map.Tap.js b/src/map/handler/Map.Tap.js index efd860e5..54dbb0f4 100644 --- a/src/map/handler/Map.Tap.js +++ b/src/map/handler/Map.Tap.js @@ -66,7 +66,7 @@ L.Map.Tap = L.Handler.extend({ var first = e.changedTouches[0], el = first.target; - if (el.tagName.toLowerCase() === 'a') { + if (el && el.tagName && el.tagName.toLowerCase() === 'a') { L.DomUtil.removeClass(el, 'leaflet-active'); }