Allow blob data to be nil

This commit is contained in:
Joshua Peek
2011-05-20 16:38:46 -05:00
parent 75cabaa275
commit 7a141e39c1

View File

@@ -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('/')