From ef105bee12d3c5f364b035e73460fbae91fa2f44 Mon Sep 17 00:00:00 2001 From: Mauricio Pasquier Juan Date: Sun, 3 May 2015 00:35:33 -0300 Subject: [PATCH] Don't fail on empty assets (fixes #20) --- lib/padrino-pipeline/compilers/sprockets.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/padrino-pipeline/compilers/sprockets.rb b/lib/padrino-pipeline/compilers/sprockets.rb index b596024..646b12a 100644 --- a/lib/padrino-pipeline/compilers/sprockets.rb +++ b/lib/padrino-pipeline/compilers/sprockets.rb @@ -62,10 +62,11 @@ def clean_js end def compile_assets(type, extensions = []) - asset = assets[@config.send("#{type.to_s}_compiled_asset")] - extensions.each do |ext| - output_path = self.send("#{type.to_s}_output_path", "application-#{asset.digest}.#{ext}") - asset.write_to output_path + unless (asset = assets[@config.send("#{type.to_s}_compiled_asset")]).nil? + extensions.each do |ext| + output_path = self.send("#{type.to_s}_output_path", "application-#{asset.digest}.#{ext}") + asset.write_to output_path + end end end