From e7244957b1105f5a446d2209f79803827a184375 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Wed, 26 Jul 2023 08:45:20 +0100 Subject: [PATCH] remove nil test --- lib/voicemeeter/cbindings.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/voicemeeter/cbindings.rb b/lib/voicemeeter/cbindings.rb index 732ce7f..4b32ddb 100644 --- a/lib/voicemeeter/cbindings.rb +++ b/lib/voicemeeter/cbindings.rb @@ -61,13 +61,13 @@ module Voicemeeter } res = send(fn, *args) - if exp.nil? - unless ok.include?(res) + if exp + unless exp.call(res) || ok.include?(res) logger.error "#{to_cname.call} returned #{res}" raise Errors::VMCAPIError.new to_cname.call, res end else - unless exp.call(res) || ok.include?(res) + unless ok.include?(res) logger.error "#{to_cname.call} returned #{res}" raise Errors::VMCAPIError.new to_cname.call, res end