From e9d7ddebb2d18fe0d0ef32424cb1f8777a70bbd6 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Tue, 27 Apr 2021 23:51:29 +0300 Subject: [PATCH] defensive code Co-authored-by: th-ch --- plugins/precise-volume/front.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/precise-volume/front.js b/plugins/precise-volume/front.js index 834c5def..a1b30fe4 100644 --- a/plugins/precise-volume/front.js +++ b/plugins/precise-volume/front.js @@ -91,7 +91,7 @@ function changeVolume(toIncrease, options) { const videoStream = $(".video-stream"); const slider = $("#volume-slider"); // Apply volume change if valid - const steps = options.steps / 100; + const steps = (options.steps || 1) / 100; videoStream.volume = toIncrease ? Math.min(videoStream.volume + steps, 1) : Math.max(videoStream.volume - steps, 0);