external: Prevent critical if DisplayName is empty
authorJens Georg <mail@jensge.org>
Thu, 9 Feb 2012 13:45:55 +0000 (15:45 +0200)
committerJens Georg <mail@jensge.org>
Thu, 9 Feb 2012 13:45:57 +0000 (15:45 +0200)
src/plugins/external/rygel-external-container.vala

index a2326c1..9991520 100644 (file)
@@ -281,7 +281,10 @@ public class Rygel.External.Container : Rygel.MediaContainer,
                                          DBusProxyFlags.DO_NOT_LOAD_PROPERTIES);
             var props = yield props_iface.get_all (MediaContainerProxy.IFACE);
             var child_count = (uint) props.lookup ("ChildCount");
-            this.title = (string) props.lookup ("DisplayName");
+            var title = props.lookup ("DisplayName");
+            if (title != null) {
+                this.title = (string) title;
+            }
             this.child_count = (int) child_count;
         } catch (GLib.Error property_error) {
             warning ("Failed to update information about container '%s': %s",