From c82cc2e62c13416a938b6941c049b47309301ba2 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Sun, 18 Mar 2012 14:19:52 +0100 Subject: [PATCH] core: Prevent crash on missing element --- src/rygel/rygel-http-identity-handler.vala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rygel/rygel-http-identity-handler.vala b/src/rygel/rygel-http-identity-handler.vala index 0981bd0..845fe32 100644 --- a/src/rygel/rygel-http-identity-handler.vala +++ b/src/rygel/rygel-http-identity-handler.vala @@ -83,15 +83,16 @@ internal class Rygel.HTTPIdentityHandler : Rygel.HTTPGetHandler { } else { src = request.item.create_stream_source (request.http_server.context.host_ip); - if (src.is_floating ()) { - src.ref_sink (); - } } if (src == null) { throw new HTTPRequestError.NOT_FOUND (_("Not found")); } + if (src.is_floating ()) { + src.ref_sink (); + } + return new HTTPResponse (request, this, src); } } -- 2.7.4