Skip to content

Commit

Permalink
[Harddisk]
Browse files Browse the repository at this point in the history
* improve refreshMountPoints
  • Loading branch information
jbleyel committed Jan 12, 2025
1 parent 72aa974 commit 4ac738a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/python/Components/Harddisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def refreshMountPoints(self):
# Remove old mounts
self.debugPrint("refreshMountPoints")
for partition in self.partitions:
if partition.mountpoint and partition.mountpoint != "/":
if partition.device and partition.mountpoint and partition.mountpoint != "/":
newMountpoint = self.getMountpoint(partition.device)
if partition.mountpoint != newMountpoint:
self.debugPrint(f"remove mountpoint old: {partition.mountpoint} / new: {newMountpoint}")
Expand All @@ -420,7 +420,7 @@ def refreshMountPoints(self):

# Add new mount
for partition in self.partitions:
if partition.mountpoint != "/":
if partition.device and partition.mountpoint != "/":
newMountpoint = self.getMountpoint(partition.device)
self.debugPrint(f"add mountpoint old: {partition.mountpoint} / new: {newMountpoint}")
if newMountpoint and partition.mountpoint != newMountpoint:
Expand Down

0 comments on commit 4ac738a

Please sign in to comment.