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



commit d79cb9f5e693015eab0c9707da96fc3eb761b209
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 f1ff6c4..f635b93 100644
--- a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/Manager.cs
+++ b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/Manager.cs
@@ -78,6 +78,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]