From 0a7c703eb56d2d5f3c145a53e74acdeea89f2499 Mon Sep 17 00:00:00 2001 From: Zee Spencer Date: Tue, 6 Mar 2018 14:51:57 -0800 Subject: [PATCH] Prevent exceptions being masked by undefined method errors in ruby 2.4 --- lib/graphviz/utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/graphviz/utils.rb b/lib/graphviz/utils.rb index 3343c84..32de289 100644 --- a/lib/graphviz/utils.rb +++ b/lib/graphviz/utils.rb @@ -55,7 +55,7 @@ def output_and_errors_from_command(cmd) #:nodoc: def output_from_command(cmd) #:nodoc: output, errors, status = output_and_errors_from_command(cmd) - if (status.nil? && (errors.nil? || errors.strip.empty?)) || status.zero? + if (status.nil? && (errors.nil? || errors.strip.empty?)) || status == 0 output else raise "Error from #{cmd}:\n#{errors}"