RygelThumbnail: Avoid a critical warning in tests.
authorMurray Cumming <murrayc@murrayc.com>
Tue, 29 Jan 2013 11:16:10 +0000 (12:16 +0100)
committerMurray Cumming <murrayc@murrayc.com>
Tue, 29 Jan 2013 11:16:27 +0000 (12:16 +0100)
src/librygel-server/rygel-thumbnail.vala

index e4f3a9c..42ed920 100644 (file)
@@ -40,7 +40,16 @@ public class Rygel.Thumbnail : Rygel.IconInfo {
                                                      string       protocol) {
         var res = didl_item.add_resource ();
 
-        res.uri = this.uri;
+        /* We check for NULL because 
+         * gupnp_didl_lite_resource_set_uri(),
+         * used by the generated code,
+         * complains, with a critical warning, if the URI is NULL.
+         * It's already the default.
+         */
+        if (this.uri != null) {
+            res.uri = this.uri;
+        }
+
         res.size64 = this.size;
 
         res.width = this.width;