From ea57227b468877b2322adebcac3fd495c178a4c1 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 14 Jul 2023 01:48:22 +0100 Subject: [PATCH] add perenthesis in call() --- lib/voicemeeter/cbindings.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/voicemeeter/cbindings.rb b/lib/voicemeeter/cbindings.rb index cd21c24..ed7cacf 100644 --- a/lib/voicemeeter/cbindings.rb +++ b/lib/voicemeeter/cbindings.rb @@ -55,11 +55,11 @@ module Voicemeeter def call(fn, *args, ok: [0], exp: nil) res = send(fn, *args) if exp.nil? - unless ok.include? res + unless ok.include?(res) raise Errors::VMCAPIError.new("#{fn} returned #{res}") end else - unless exp.call(res) + unless exp.call(res) && ok.include?(res) raise Errors::VMCAPIError.new("#{fn} returned #{res}") end end