Skip to content

Commit

Permalink
Handle nil pointer dereference. Fix #2133
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Feb 1, 2023
1 parent 58c4682 commit aaf58bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scanner/tag_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit aaf58bb

Please sign in to comment.