aboutsummaryrefslogtreecommitdiff
path: root/file.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-01-14 04:40:19 +0700
committerShulhan <ms@kilabit.info>2026-01-14 04:40:19 +0700
commitb37a4cd18827d6a8dafe2729ba72a8e13e8fbb8c (patch)
treefec0411825230780e08a8cf6619b683e46898e01 /file.go
parent9801b1cf64dbf8340fe532542bae186a6bb507dd (diff)
downloadspdxconv-b37a4cd18827d6a8dafe2729ba72a8e13e8fbb8c.tar.xz
all: fix error when scanning and apply empty file
Diffstat (limited to 'file.go')
-rw-r--r--file.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/file.go b/file.go
index 11d2154..c98beb1 100644
--- a/file.go
+++ b/file.go
@@ -95,6 +95,9 @@ func (f *file) initLines(content []byte, maxLine int) (err error) {
if err != nil {
return err
}
+ if len(content) == 0 {
+ return nil
+ }
}
f.lines = bytes.Split(content, []byte{'\n'})