Skip to content

Commit

Permalink
Handle nil as a sass_filename. Closes #1883.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseppstein committed Nov 26, 2014
1 parent 4eafd3d commit 7392898
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cli/lib/compass/sass_compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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})"
Expand Down

0 comments on commit 7392898

Please sign in to comment.