[banshee/stable-2.6] Gio: don't try to mount null devices (bgo#726147)



commit 4bfe80d0d9cf74089221b3798aea0cba5c200d63
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Wed Mar 19 02:37:03 2014 +0100

    Gio: don't try to mount null devices (bgo#726147)
    
    The log in bgo#726147 can tell us that we were forgetting a null
    check in HandleMonitorMountAdded(). Turns out we had a similar
    null check a bit later in this file in the VolumeRemoved() method,
    which I copy-pasted here just by replacing the "unmount" word in
    the log statement with "mount" in this case.

 .../Banshee.Hardware.Gio/LowLevel/Manager.cs       |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/Manager.cs 
b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/Manager.cs
index 213e747..ee6ed56 100644
--- a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/Manager.cs
+++ b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/Manager.cs
@@ -77,6 +77,11 @@ namespace Banshee.Hardware.Gio
                 return;
 
             var device = GudevDeviceFromGioMount (mount);
+            if (device == null) {
+                Hyena.Log.Debug (string.Format ("Tried to mount {0}/{1} with no matching udev device", 
mount.Volume.Name, mount.Volume.Uuid));
+                return;
+            }
+
             volume_device_map [mount.Volume.Handle] = device;
             var h = DeviceAdded;
             if (h != null) {


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