Skip to content

Commit

Permalink
Merge pull request #330 from jaypipes/issue-267
Browse files Browse the repository at this point in the history
fix Windows disk drive index comparison
  • Loading branch information
jaypipes committed Feb 6, 2023
2 parents 77ab5ed + 7c8936e commit ae21148
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/block/block_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ func (i *Info) load() error {
}
for _, diskpartition := range win32DiskPartitionDescriptions {
// Finding disk partition linked to current disk drive
if diskdrive.Index == diskpartition.DiskIndex {
if diskdrive.Index == nil || diskpartition.DiskIndex == nil {
continue
}
if *diskdrive.Index == *diskpartition.DiskIndex {
disk.PhysicalBlockSizeBytes = *diskpartition.BlockSize
// Finding logical partition linked to current disk partition
for _, logicaldisk := range win32LogicalDiskDescriptions {
Expand Down

0 comments on commit ae21148

Please sign in to comment.