[rygel] server: Stop crash if force-downgrade-for is empty



commit edc98b6ab22298af6c5150cd69ceca771d09d0d7
Author: Jens Georg <jensg openismus com>
Date:   Sat Oct 6 22:40:57 2012 +0200

    server: Stop crash if force-downgrade-for is empty
    
    Fixes:
      https://bugzilla.gnome.org/show_bug.cgi?id=683934

 src/librygel-server/rygel-v1-hacks.vala |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/librygel-server/rygel-v1-hacks.vala b/src/librygel-server/rygel-v1-hacks.vala
index 907b8af..9128f91 100644
--- a/src/librygel-server/rygel-v1-hacks.vala
+++ b/src/librygel-server/rygel-v1-hacks.vala
@@ -74,6 +74,8 @@ internal class Rygel.V1Hacks : ClientHacks {
 
         if (agents.length > 0) {
             agent_pattern = string.joinv ("|", agents);
+        } else {
+            agent_pattern = "";
         }
 
         debug ("V1 downgrade will be applied for devices matching %s",
@@ -105,8 +107,10 @@ internal class Rygel.V1Hacks : ClientHacks {
         description_file.save (this.description_path);
 
         var server_path = "/" + device.get_relative_location ();
-        device.context.host_path_for_agent (this.description_path,
-                                            server_path,
-                                            this.agent_regex);
+        if (this.agent_regex.get_pattern () != "") {
+            device.context.host_path_for_agent (this.description_path,
+                                                server_path,
+                                                this.agent_regex);
+        }
     }
 }



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