Skip to content

Commit

Permalink
Fix invalid memory error after deleting a watched file
Browse files Browse the repository at this point in the history
Closes #3
  • Loading branch information
maxcnunes committed Sep 8, 2018
1 parent 7f52687 commit e4d6c94
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ func (w *watcher) scanChange(watchPath string) (string, error) {
}

func (w *watcher) ignoreFile(path string, info os.FileInfo) bool {
// if a file has been deleted after gaper was watching it
// info will be nil in the other iterations
if info == nil {
return true
}

// check if preset ignore is enabled
if w.defaultIgnore {
// check for hidden files and directories
Expand Down

0 comments on commit e4d6c94

Please sign in to comment.