Commit f909e25d1b0e6fec2852631715c0e3886e145477

Authored by randx
1 parent 5ff658a6

Improve gitlab encode method

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
lib/gitlab/encode.rb
@@ -27,7 +27,8 @@ module Gitlab @@ -27,7 +27,8 @@ module Gitlab
27 27
28 # Prevent app from crash cause of encoding errors 28 # Prevent app from crash cause of encoding errors
29 rescue 29 rescue
30 - "--broken encoding: #{detect[:encoding]}" 30 + encoding = detect ? detect[:encoding] : "unknown"
  31 + "--broken encoding: #{encoding}"
31 end 32 end
32 33
33 def detect_encoding message 34 def detect_encoding message