[banshee] RhapsodyQueryJob: Fix NRE for track with no album (bgo#646028)
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] RhapsodyQueryJob: Fix NRE for track with no album (bgo#646028)
- Date: Tue, 29 Mar 2011 15:17:34 +0000 (UTC)
commit 0c5d9f6eda9004ba40f1cbee8bc27e6e8c3f63c0
Author: Zhou Ting <ting z zhou intel com>
Date: Fri Mar 25 19:01:55 2011 +0800
RhapsodyQueryJob: Fix NRE for track with no album (bgo#646028)
Signed-off-by: Gabriel Burt <gabriel burt gmail com>
.../Banshee.Metadata.Rhapsody/RhapsodyQueryJob.cs | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Metadata.Rhapsody/RhapsodyQueryJob.cs b/src/Core/Banshee.Services/Banshee.Metadata.Rhapsody/RhapsodyQueryJob.cs
index 3c04a24..3f59ff4 100644
--- a/src/Core/Banshee.Services/Banshee.Metadata.Rhapsody/RhapsodyQueryJob.cs
+++ b/src/Core/Banshee.Services/Banshee.Metadata.Rhapsody/RhapsodyQueryJob.cs
@@ -56,6 +56,10 @@ namespace Banshee.Metadata.Rhapsody
private static string GetAlbumUrl (IBasicTrackInfo track)
{
+ if (track == null || track.AlbumArtist == null || track.AlbumTitle == null) {
+ return null;
+ }
+
string artist = EscapeUrlPart (track.AlbumArtist);
string album = EscapeUrlPart (track.AlbumTitle);
return String.Format ("{0}/{1}", artist, album);
@@ -68,7 +72,8 @@ namespace Banshee.Metadata.Rhapsody
public override void Run()
{
- if (Track == null || (Track.MediaAttributes & TrackMediaAttributes.Podcast) != 0) {
+ if (Track == null || (Track.MediaAttributes & TrackMediaAttributes.Podcast) != 0
+ || GetAlbumUrl (Track) == null) {
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]