mirror of
https://github.com/zoriya/flood.git
synced 2026-06-01 02:29:01 +00:00
server: DiskUsage: ensure disk.target is string before evaluating its length
This commit is contained in:
@@ -61,7 +61,7 @@ class DiskUsage extends (EventEmitter as new () => TypedEmitter<DiskUsageEvents>
|
||||
return diskUsage[process.platform as SupportedPlatform]()
|
||||
.then((disks) => {
|
||||
// Mountpoints with a very long path are unlikely to be useful.
|
||||
return disks.filter((disk) => disk.target.length < 30);
|
||||
return disks.filter((disk) => typeof disk.target === 'string' && disk.target.length < 30);
|
||||
})
|
||||
.then((disks) => {
|
||||
if (disks.length !== this.disks.length || disks.some((d, i) => d.used !== this.disks[i].used)) {
|
||||
|
||||
Reference in New Issue
Block a user