[rygel] RygelThumbnail: Avoid a critical warning in tests.



commit 5aa254a68fb0e6fff423dc4236cbcc407bb95c38
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Jan 29 12:16:10 2013 +0100

    RygelThumbnail: Avoid a critical warning in tests.

 src/librygel-server/rygel-thumbnail.vala |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/librygel-server/rygel-thumbnail.vala b/src/librygel-server/rygel-thumbnail.vala
index e4f3a9c..42ed920 100644
--- a/src/librygel-server/rygel-thumbnail.vala
+++ b/src/librygel-server/rygel-thumbnail.vala
@@ -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;



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