diff --git a/Sortable.js b/Sortable.js index 3176f3a..bcc6b13 100644 --- a/Sortable.js +++ b/Sortable.js @@ -171,13 +171,15 @@ _dragStarted: function () { - // Apply effect - _toggleClass(dragEl, this.options.ghostClass, true); + if (rootEl && dragEl) { + // Apply effect + _toggleClass(dragEl, this.options.ghostClass, true); - Sortable.active = this; + Sortable.active = this; - // Drag start event - _dispatchEvent(rootEl, 'start', dragEl, rootEl, oldIndex); + // Drag start event + _dispatchEvent(rootEl, 'start', dragEl, rootEl, oldIndex); + } },