[banshee] Gio: prevent a freeze when mounting a LVM volume (bgo#699735)
- From: Andrés Aragoneses <aaragoneses src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] Gio: prevent a freeze when mounting a LVM volume (bgo#699735)
- Date: Thu, 16 May 2013 15:21:55 +0000 (UTC)
commit d759956843db7951cb0ad42649b4d85d770c9924
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]