diff --git a/src/js/plugin/destroy.js b/src/js/plugin/destroy.js index 67bc2b9..126726b 100644 --- a/src/js/plugin/destroy.js +++ b/src/js/plugin/destroy.js @@ -11,7 +11,7 @@ module.exports = function (element) { var i = instances.get(element); if (!i) { - throw new Error('perfect-scrollbar: instance not found'); + return; } i.event.unbindAll(); diff --git a/src/js/plugin/update.js b/src/js/plugin/update.js index 5da6b18..6d0edfd 100644 --- a/src/js/plugin/update.js +++ b/src/js/plugin/update.js @@ -12,7 +12,7 @@ module.exports = function (element) { var i = instances.get(element); if (!i) { - throw new Error('perfect-scrollbar: instance not found'); + return; } // Recalcuate negative scrollLeft adjustment