Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
Fixes issue #70
Browse files Browse the repository at this point in the history
Not exactly the best fix, but it'll do.
  • Loading branch information
howeyc committed Oct 19, 2013
1 parent ba28565 commit 6258bb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fsnotify_bsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func (w *Watcher) readEvents() {
fileEvent.Name = w.paths[int(watchEvent.Ident)]
fileInfo := w.finfo[int(watchEvent.Ident)]
w.pmut.Unlock()
if fileInfo.IsDir() && !fileEvent.IsDelete() {
if fileInfo != nil && fileInfo.IsDir() && !fileEvent.IsDelete() {
// Double check to make sure the directory exist. This can happen when
// we do a rm -fr on a recursively watched folders and we receive a
// modification event first but the folder has been deleted and later
Expand All @@ -360,7 +360,7 @@ func (w *Watcher) readEvents() {
}
}

if fileInfo.IsDir() && fileEvent.IsModify() && !fileEvent.IsDelete() {
if fileInfo != nil && fileInfo.IsDir() && fileEvent.IsModify() && !fileEvent.IsDelete() {
w.sendDirectoryChangeEvents(fileEvent.Name)
} else {
// Send the event on the events channel
Expand Down

0 comments on commit 6258bb8

Please sign in to comment.