Browse files

[helpers] Only escape output if data exists

  • Loading branch information...
1 parent dcbae6e commit 63e63a0315fabd2ed0b161a9558f490ec02111cc @nesquena nesquena committed May 11, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rabl/helpers.rb
View
2 lib/rabl/helpers.rb
@@ -97,7 +97,7 @@ def template_cache_configured?
# Escape output if configured and supported
def escape_output(data)
- defined?(ERB::Util.h) && Rabl.configuration.escape_all_output ? ERB::Util.h(data) : data
+ (data && defined?(ERB::Util.h) && Rabl.configuration.escape_all_output) ? ERB::Util.h(data) : data
end
end

0 comments on commit 63e63a0

Please sign in to comment.