Fix sudden nil pointer dereference in walk

This commit is contained in:
Jakob Borg 2015-09-04 13:13:00 +02:00
parent 4a9997e449
commit 37ed5a01e0

View File

@ -240,7 +240,7 @@ func (w *Walker) walkAndHashFiles(fchan, dchan chan protocol.FileInfo) filepath.
}
if sn := filepath.Base(rn); sn == ".stignore" || sn == ".stfolder" ||
strings.HasPrefix(rn, ".stversions") || w.Matcher.Match(rn) {
strings.HasPrefix(rn, ".stversions") || (w.Matcher != nil && w.Matcher.Match(rn)) {
// An ignored file
if debug {
l.Debugln("ignored:", rn)