From 86b7debcb27d9168afefa9630047d2c139f09246 Mon Sep 17 00:00:00 2001 From: jbleyel Date: Tue, 7 Jan 2025 12:18:04 +0100 Subject: [PATCH] [HardDisk] * prevent crash if partition mountpoint is None This is a timing issue and should be improved. --- lib/python/Components/Harddisk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py index 870893e06ae..5c74c24590f 100644 --- a/lib/python/Components/Harddisk.py +++ b/lib/python/Components/Harddisk.py @@ -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):