aboutsummaryrefslogtreecommitdiff
path: root/file.go
diff options
context:
space:
mode:
Diffstat (limited to 'file.go')
-rw-r--r--file.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/file.go b/file.go
index 80780d1..80c369c 100644
--- a/file.go
+++ b/file.go
@@ -119,7 +119,7 @@ func (f *file) initLines(content []byte, maxLine int) (err error) {
f.lines = f.lines[maxLine : nline-maxLine]
}
- if bytes.HasPrefix(f.topLines[0], []byte(`#!`)) {
+ if len(f.topLines) != 0 && bytes.HasPrefix(f.topLines[0], []byte(`#!`)) {
f.hasSheBang = true
}
return nil