fix crash upon invalid mountpoint
authorAndreas Frisch <andreas.frisch@multimedia-labs.de>
Sun, 26 Oct 2008 19:54:09 +0000 (19:54 +0000)
committerAndreas Frisch <andreas.frisch@multimedia-labs.de>
Sun, 26 Oct 2008 19:54:09 +0000 (19:54 +0000)
lib/python/Components/Scanner.py

index 95e2e8f..d944c4c 100644 (file)
@@ -134,7 +134,7 @@ def scanDevice(mountpoint):
        paths_to_scan = list(paths_to_scan)
        
        from Components.Harddisk import harddiskmanager 
        paths_to_scan = list(paths_to_scan)
        
        from Components.Harddisk import harddiskmanager 
-       blockdev = mountpoint.split('/')[2]
+       blockdev = mountpoint.rsplit('/',1)[-1]
        error, blacklisted, removable, is_cdrom, partitions = harddiskmanager.getBlockDevInfo(blockdev)
 
        # now scan the paths
        error, blacklisted, removable, is_cdrom, partitions = harddiskmanager.getBlockDevInfo(blockdev)
 
        # now scan the paths