From d2b793be8e880c860e305ceb5a6adeaad6b77541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beausoleil?= Date: Thu, 2 Sep 2021 16:45:35 -0400 Subject: [PATCH] Fix a result of ["ok", {"error": []}] failed, when it was clearly OK --- lib/uglifier.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/uglifier.rb b/lib/uglifier.rb index 8a5d529..f118659 100644 --- a/lib/uglifier.rb +++ b/lib/uglifier.rb @@ -231,12 +231,12 @@ def error_message(result) end def parse_result(result, generate_map) - raise Error, error_message(result) if result.has_key?('error') + raise Error, error_message(result) if result.has_key?('error') && result['error'].respond_to?(:any?) && result['error'].any? if generate_map [result['code'] + source_map_comments, result['map']] else - result['code'] + source_map_comments + (result['code'] || "") + source_map_comments end end