[rygel] core: Prevent critical if there's no User-Agent



commit e512c4107fb6e8172b2a4c1f85588673165f2da1
Author: Jens Georg <mail jensge org>
Date:   Mon May 2 12:11:49 2011 +0200

    core: Prevent critical if there's no User-Agent

 src/rygel/rygel-xbox-hacks.vala |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-xbox-hacks.vala b/src/rygel/rygel-xbox-hacks.vala
index ac925df..ae4451f 100644
--- a/src/rygel/rygel-xbox-hacks.vala
+++ b/src/rygel/rygel-xbox-hacks.vala
@@ -39,7 +39,8 @@ internal class Rygel.XBoxHacks : GLib.Object {
     public XBoxHacks.for_action (ServiceAction action) throws XBoxHacksError {
         unowned MessageHeaders headers = action.get_message ().request_headers;
         var agent = headers.get_one ("User-Agent");
-        if (!(agent.contains ("Xbox")) &&
+        if (agent == null ||
+            !(agent.contains ("Xbox")) &&
             !(agent.contains ("Allegro-Software-WebClient"))) {
             throw new XBoxHacksError.NA (_("Not Applicable"));
         }



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