[banshee/stable-2.6] Gio: prevent a freeze when mounting a LVM volume (bgo#699735)



commit 1f8d8746eb122449a3489901a87f8a15e54ae4cf
Author: Andres G. Aragoneses <knocte gmail com>
Date:   Thu May 16 16:21:26 2013 +0100

    Gio: prevent a freeze when mounting a LVM volume (bgo#699735)
    
    For some reason the HardwareManager could not get a GudevDevice
    from the Volume.Drive in this case, which resulted in passing
    null to UdevMetadataSource and causing a NullReferenceException,
    which would make Banshee freeze.
    
    Fix this by checking for null after calling GudevDeviceFromGioDrive.

 .../Banshee.Hardware.Gio/LowLevel/RawVolume.cs     |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawVolume.cs 
b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawVolume.cs
index 0ac09f9..5e8dc80 100644
--- a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawVolume.cs
+++ b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawVolume.cs
@@ -239,10 +239,15 @@ namespace Banshee.Hardware.Gio
                 if (Volume.Drive == null) {
                     return null;
                 }
+
+                var device = Manager.GudevDeviceFromGioDrive (Volume.Drive);
+                if (device == null) {
+                    return null;
+                }
                 return new RawBlockDevice (Volume.Drive,
                                            Manager,
                                            new GioDriveMetadetaSource (Volume.Drive),
-                                           new UdevMetadataSource (Manager.GudevDeviceFromGioDrive 
(Volume.Drive)));
+                                           new UdevMetadataSource (device));
             }
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]