From 9cbddb8293b6516f241e6123a1926e5949ee4e47 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Wed, 25 May 2011 13:29:47 -0500 Subject: [PATCH] Only read lines if blob is viewable --- lib/linguist/blob_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index a53d4a68..22a019ad 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -124,7 +124,7 @@ module Linguist # # Returns an Array of lines def lines - @lines ||= data ? data.split("\n", -1) : [] + @lines ||= (viewable? && data) ? data.split("\n", -1) : [] end # Public: Get number of lines of code