From f909e25d1b0e6fec2852631715c0e3886e145477 Mon Sep 17 00:00:00 2001 From: randx Date: Sun, 17 Jun 2012 22:00:13 +0300 Subject: [PATCH] Improve gitlab encode method --- lib/gitlab/encode.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/encode.rb b/lib/gitlab/encode.rb index 8b6ffa3d49b..0787434b3af 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