[banshee] XspfMigrator: Check that the default radio stations directory exists



commit 188ba98b0b475deabd271b8245e9f322b28d3557
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Sun Sep 4 11:08:22 2011 +0200

    XspfMigrator: Check that the default radio stations directory exists
    
    This prevents a harmless DirectoryNotFoundException, which was caught
    but potentially misleading.

 .../Banshee.InternetRadio/XspfMigrator.cs          |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/XspfMigrator.cs b/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/XspfMigrator.cs
index 2ae850b..eae7e8c 100644
--- a/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/XspfMigrator.cs
+++ b/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/XspfMigrator.cs
@@ -58,6 +58,10 @@ namespace Banshee.InternetRadio
             DatabaseConfigurationClient.Client.Set<bool> ("InternetRadio.SystemXspfLoaded", true);
 
             string xspf_system_path = Hyena.Paths.GetInstalledDataDirectory ("stations");
+            if (!Directory.Exists (xspf_system_path)) {
+                return false;
+            }
+            
             try {
                 foreach (string file in Directory.GetFiles (xspf_system_path, "*.xspf")) {
                     Log.DebugFormat ("Loading default Internet Radio Stations from {0}", file);



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