Handle nil pointer dereference. Fix #2133

This commit is contained in:
Deluan 2023-01-31 20:54:15 -05:00
parent 58c46827cd
commit aaf58bbd32
1 changed files with 4 additions and 1 deletions

View File

@ -168,7 +168,10 @@ func (s *TagScanner) Scan(ctx context.Context, lastModifiedSince time.Time, prog
func isDirEmpty(ctx context.Context, dir string) (bool, error) {
children, stats, err := loadDir(ctx, dir)
return len(children) == 0 && stats.AudioFilesCount == 0, err
if err != nil {
return false, err
}
return len(children) == 0 && stats.AudioFilesCount == 0, nil
}
func (s *TagScanner) getRootFolderWalker(ctx context.Context) (walkResults, chan error) {