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