Skip to content

Commit

Permalink
[HardDisk]
Browse files Browse the repository at this point in the history
* prevent crash if partition mountpoint is None

This is a timing issue and should be improved.
  • Loading branch information
jbleyel committed Jan 7, 2025
1 parent 51b98fd commit 86b7deb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/python/Components/Harddisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ def getMountedPartitions(self, onlyhotplug=False, mounts=None):
dev, part = self.splitDeviceName(devname)
if part and dev in devs: # If this is a partition and we still have the whole disk, remove the whole disk.
devs.remove(dev)
return [x for x in parts if not x.device or x.device in devs] # Return all devices which are not removed due to being a whole disk when a partition exists.
return [x for x in parts if (not x.device or x.device in devs) and x.mountpoint] # Return all devices which are not removed due to being a whole disk when a partition exists.

def splitDeviceName(self, devname):
if search(r"^mmcblk\d(?:p\d+$|$)", devname):
Expand Down

0 comments on commit 86b7deb

Please sign in to comment.