summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres G. Aragoneses <knocte@gmail.com>2013-05-16 16:21:26 +0100
committerAndres G. Aragoneses <knocte@gmail.com>2013-05-16 16:21:47 +0100
commitd759956843db7951cb0ad42649b4d85d770c9924 (patch)
tree69b3be6cefe65056fb841a9828cf68246c043551
parenta2b8d67c01603c10977a94db5820f4e70cd87a81 (diff)
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.
-rw-r--r--src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawVolume.cs7
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 0ac09f98a..5e8dc801b 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));
}
}