From 7a141e39c18e91847a3b888821e5785ab02dc0a3 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 20 May 2011 16:38:46 -0500 Subject: [PATCH] Allow blob data to be nil --- 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 6ce4799e..ffe1e278 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -84,7 +84,7 @@ module Linguist def shebang_script return if !text? || large? - if (match = data.match(/(.+)\n?/)) && (bang = match[0]) =~ /^#!/ + if data && (match = data.match(/(.+)\n?/)) && (bang = match[0]) =~ /^#!/ bang.sub!(/^#! /, '#!') tokens = bang.split(' ') pieces = tokens.first.split('/')