[banshee/stable-2.4] UPnPServerSource: Fix crash when getting the root object (bgo#672744)



commit b627217e3841ca7d0b8af1ed8f916436e5088cee
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Sat Mar 24 12:27:06 2012 +0100

    UPnPServerSource: Fix crash when getting the root object (bgo#672744)
    
    Move the GetRootObject () call inside the try/catch block, so that
    exceptions from Mono.Upnp don't cause a crash.

 .../Banshee.UPnPClient/UPnPServerSource.cs         |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPServerSource.cs b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPServerSource.cs
index 04a743a..5412663 100644
--- a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPServerSource.cs
+++ b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPServerSource.cs
@@ -124,10 +124,11 @@ namespace Banshee.UPnPClient
         {
             RemoteContentDirectory remote_dir = new RemoteContentDirectory (content_directory);
             DateTime begin = DateTime.Now;
-            Container root = remote_dir.GetRootObject ();
             bool recursive_browse = !content_directory.CanSearch;
 
             try {
+                Container root = remote_dir.GetRootObject ();
+
                 if (!recursive_browse) {
                     try {
                         Log.Debug ("Content directory is searchable, let's search");



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