diff --git a/README.md b/README.md index e7c26d2..6f27c3d 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,8 @@ supported as replacement, no regexp submatch support yet (planned, though). ## Changelog + - 1.3 + - Fix stack trace dump on Linux when file is not readable - 1.2 - `.gitignore` fixes will never end it seems, another one - 1.1 diff --git a/goreplace.go b/goreplace.go index 7c00434..e022c81 100644 --- a/goreplace.go +++ b/goreplace.go @@ -15,7 +15,7 @@ import ( var ( Author = "Alexander Solovyov" - Version = "1.2" + Version = "1.3" byteNewLine = []byte("\n") ) @@ -185,6 +185,9 @@ func (v *GRVisitor) VisitFile(fn string, fi os.FileInfo) { } f, content := v.GetFileAndContent(fn, fi) + if f == nil { + return + } defer f.Close() if opts.Replace == nil {