Blob Blame History Raw
From d79cb9f5e693015eab0c9707da96fc3eb761b209 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= <knocte@gmail.com>
Date: Wed, 19 Mar 2014 02:37:03 +0100
Subject: [PATCH] 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.
---
 src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/Manager.cs | 5 +++++
 1 file changed, 5 insertions(+)

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 @@ void HandleMonitorMountAdded (object o, MountAddedArgs args)
                 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) {
-- 
1.9.3