From 6c642d8a478ce231aad98aee7f6cd541cac816d2 Mon Sep 17 00:00:00 2001 From: Hyunje Alex Jun Date: Tue, 14 Jul 2015 12:22:40 +0900 Subject: [PATCH] Just early return instead of throwing an error for no instance. --- src/js/plugin/destroy.js | 2 +- src/js/plugin/update.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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