Closed syohex closed 7 years ago
fi(os.FileInfo) is nil when err is not nil. And this causes panic.
% jvgrep foo non-exists-file.txt panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x40818f] goroutine 1 [running]: panic(0x505a80, 0xc42000e0f0) /opt/go/src/runtime/panic.go:500 +0x1a1 main.doMain(0xc4200001a0) /home/syohei/go/src/github.com/mattn/jvgrep/jvgrep.go:878 +0x314f main.main() /home/syohei/go/src/github.com/mattn/jvgrep/jvgrep.go:1066 +0x22
Thank you
fi(os.FileInfo) is nil when err is not nil. And this causes panic.