diff options
| author | Shulhan <ms@kilabit.info> | 2026-01-14 04:40:19 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2026-01-14 04:40:19 +0700 |
| commit | b37a4cd18827d6a8dafe2729ba72a8e13e8fbb8c (patch) | |
| tree | fec0411825230780e08a8cf6619b683e46898e01 /file.go | |
| parent | 9801b1cf64dbf8340fe532542bae186a6bb507dd (diff) | |
| download | spdxconv-b37a4cd18827d6a8dafe2729ba72a8e13e8fbb8c.tar.xz | |
all: fix error when scanning and apply empty file
Diffstat (limited to 'file.go')
| -rw-r--r-- | file.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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'}) |
