[banshee] AppleDevice: null check for MediaDatabase.PodcastPlaylist (bgo#679260)



commit 39a45dd963d717c83605abe24e93a055f8c53769
Author: Andres G. Aragoneses <knocte gmail com>
Date:   Sun Jul 8 16:38:34 2012 +0100

    AppleDevice: null check for MediaDatabase.PodcastPlaylist (bgo#679260)
    
    If invalid tracks are found in the iPod, they could be
    marked as podcast without having a podcast playlist in
    place, which would cause a NullReferenceException when
    trying to remove them.
    
    Fixes BGO#679260.

 .../Banshee.Dap.AppleDevice/AppleDeviceSource.cs   |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs b/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs
index 849c546..b09635b 100644
--- a/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs
+++ b/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs
@@ -440,7 +440,9 @@ namespace Banshee.Dap.AppleDevice
                 playlist.Tracks.Remove (track);
             }
 
-            if (SupportsPodcasts && track.MediaType == GPod.MediaType.Podcast) {
+            if (SupportsPodcasts &&
+                track.MediaType == GPod.MediaType.Podcast &&
+                MediaDatabase.PodcastsPlaylist != null) {
                 MediaDatabase.PodcastsPlaylist.Tracks.Remove (track);
             }
 



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