Skip to content

Commit

Permalink
check response body only when it is available
Browse files Browse the repository at this point in the history
  • Loading branch information
flyerhzm committed Jun 7, 2012
1 parent 116c603 commit 604b6d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/bullet/rack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def call(env)
def empty?(response)
# response may be ["Not Found"], ["Move Permanently"], etc.
(response.is_a?(Array) && response.size <= 1) ||
!response.body.is_a?(String) || response.body.empty?
!response.respond_to?(:body) ||
!response.body.is_a?(String) || response.body.empty?
end

# if send file?
Expand Down

0 comments on commit 604b6d3

Please sign in to comment.