Skip to content

Commit

Permalink
Merge pull request #29 from NETWAYS/catch_stat_errors
Browse files Browse the repository at this point in the history
Don't try to derefence disk.usage pointer in error case
  • Loading branch information
RincewindsHat authored Mar 18, 2024
2 parents eebe27e + daa0c86 commit e8ff1a2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/filesystem/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ func GetDiskUsageSingle(ctx context.Context, timeout time.Duration, fs *Filesyst
go func() {
tmp := tmpFileSystemWrapper{}
usageStats, err := disk.Usage(fs.PartStats.Mountpoint)
tmp.usage = *usageStats

if err == nil {
tmp.usage = *usageStats
}

tmp.err = err

resChan <- tmp
Expand Down

0 comments on commit e8ff1a2

Please sign in to comment.