diff --git a/package.json b/package.json index b8182e3..ba29aa0 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Vue directive for custom scrollbar that uses native scroll behavior. Lightweight, performant and without dependencies.", "author": "Dominik Serafin ", "license": "MIT", - "version": "0.0.19", + "version": "0.0.20", "private": false, "repository": { "type": "git", diff --git a/vuebar.js b/vuebar.js index cb64363..dffd3d4 100644 --- a/vuebar.js +++ b/vuebar.js @@ -590,11 +590,8 @@ function destroyScrollbar(el, options){ var options = options ? options : {}; var state = getState(el); + if (!state) return; - if (!state) { - return; - } - // clear events state.dragger.removeEventListener('mousedown', state.barMousedown, 0); state.el2.removeEventListener('scroll', state.scrollHandler, 0);