[banshee] MtpSource: prevent a crash when dealing with Nexus4 (bgo#722947)



commit 49bbdeacef29554fac1fcd297ed29fc4d5fae9f9
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Sat Jan 25 03:13:38 2014 +0100

    MtpSource: prevent a crash when dealing with Nexus4 (bgo#722947)
    
    Similar fix to this recent one[1], but which I managed to
    reproduce with a Nexus4.
    
    [1] https://git.gnome.org/browse/banshee/commit/?h=stable-2.6&id=4f69e71970a9db3b8e5930fc6af06718cabc11e4

 .../Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs   |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs 
b/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs
index c46274d..c1678ee 100644
--- a/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs
+++ b/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs
@@ -311,7 +311,7 @@ namespace Banshee.Dap.Mtp
         private long bytes_capacity;
         public override long BytesCapacity {
             get {
-                if (Monitor.TryEnter (mtp_device)) {
+                if (mtp_device != null && Monitor.TryEnter (mtp_device)) {
                     try {
                         bytes_capacity = 0;
                         foreach (DeviceStorage s in mtp_device.GetStorage ()) {


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