From 576a0f9c3392bbdf01765b8595f28f57bd644f49 Mon Sep 17 00:00:00 2001 From: Ronny Mikalsen Date: Mon, 14 Mar 2022 14:26:11 +0100 Subject: [PATCH] fix: setting contacts to 0 if below 0 --- src/mousetracker.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mousetracker.js b/src/mousetracker.js index 4e96d23b..8c811326 100644 --- a/src/mousetracker.js +++ b/src/mousetracker.js @@ -1400,8 +1400,10 @@ * @function */ removeContact: function() { - if ( this.contacts > 0 ) { - --this.contacts; + --this.contacts; + + if (this.contacts < 0) { + this.contacts = 0; } } };