banshee r4352 - in trunk/banshee: . src/Libraries/Lastfm/Lastfm.Data



Author: gburt
Date: Tue Aug 12 17:03:17 2008
New Revision: 4352
URL: http://svn.gnome.org/viewvc/banshee?rev=4352&view=rev

Log:
2008-08-12  Gabriel Burt  <gabriel burt gmail com>

	* src/Libraries/Lastfm/Lastfm.Data/DataCore.cs: Patch from FÃlix Velasco
	and myself adding NRE protection, should fix some issues with
	recommendation pane not showing up (BGO #547177).


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Libraries/Lastfm/Lastfm.Data/DataCore.cs

Modified: trunk/banshee/src/Libraries/Lastfm/Lastfm.Data/DataCore.cs
==============================================================================
--- trunk/banshee/src/Libraries/Lastfm/Lastfm.Data/DataCore.cs	(original)
+++ trunk/banshee/src/Libraries/Lastfm/Lastfm.Data/DataCore.cs	Tue Aug 12 17:03:17 2008
@@ -77,6 +77,10 @@
 
         internal static string DownloadContent (string data_url, string cache_file, CacheDuration cache_duration)
         {
+            if (String.IsNullOrEmpty (data_url) || String.IsNullOrEmpty (cache_file)) {
+                return null;
+            }
+
             data_url = FixLastfmUrl (data_url);
             // See if we have a valid cached copy
             if (cache_duration != CacheDuration.None) {
@@ -117,6 +121,10 @@
         
         public static string GetCachedPathFromUrl (string url)
         {
+            if (url == null) {
+                return null;
+            }
+
             string hash = FixLastfmUrl (url).GetHashCode ().ToString ("X").ToLower ();
             if (hash.Length > 2) {
                 return Path.Combine (Path.Combine (DataCore.CachePath, hash.Substring (0, 2)), hash);



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