diff --git a/lib/gitlab/encode.rb b/lib/gitlab/encode.rb index 8b6ffa3d..0787434b 100644 --- a/lib/gitlab/encode.rb +++ b/lib/gitlab/encode.rb @@ -27,7 +27,8 @@ module Gitlab # Prevent app from crash cause of encoding errors rescue - "--broken encoding: #{detect[:encoding]}" + encoding = detect ? detect[:encoding] : "unknown" + "--broken encoding: #{encoding}" end def detect_encoding message