diff --git a/cli/lib/compass/sass_compiler.rb b/cli/lib/compass/sass_compiler.rb index 068471b739..588ad54dad 100644 --- a/cli/lib/compass/sass_compiler.rb +++ b/cli/lib/compass/sass_compiler.rb @@ -113,10 +113,11 @@ def when_deleting_sourcemap(filename) def when_compilation_error(error, sass_file, css_file, sourcemap_file) @error_count += 1 if error.respond_to?(:sass_filename) - if relativize(error.sass_filename) == relativize(sass_file) - logger.record :error, "#{relativize(error.sass_filename)} (Line #{error.sass_line}: #{error.message})" + error_filename = error.sass_filename || sass_file + if relativize(error_filename) == relativize(sass_file) + logger.record :error, "#{relativize(sass_file)} (Line #{error.sass_line}: #{error.message})" else - logger.record :error, "#{relativize(sass_file)} (Line #{error.sass_line} of #{relativize(error.sass_filename)}: #{error.message})" + logger.record :error, "#{relativize(sass_file)} (Line #{error.sass_line} of #{relativize(error_filename)}: #{error.message})" end else logger.record :error, "#{relativize(sass_file)} (#{error.backtrace.first}: #{error.message})"