From 562c941e1e3736d4f0c47f87c07c93d30cac0029 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Mon, 25 Sep 2017 17:00:40 +0300 Subject: [PATCH] Fix for empty EXECJS_RUNTIME --- lib/execjs/runtimes.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/execjs/runtimes.rb b/lib/execjs/runtimes.rb index 52dc3c9..ac6cd90 100644 --- a/lib/execjs/runtimes.rb +++ b/lib/execjs/runtimes.rb @@ -64,7 +64,9 @@ module ExecJS end def self.from_environment - if name = ENV["EXECJS_RUNTIME"] + env = ENV["EXECJS_RUNTIME"] + if env && !env.empty? + name = env raise RuntimeUnavailable, "#{name} runtime is not defined" unless const_defined?(name) runtime = const_get(name)