From de9f07ca0a2173a33b2abca77d5241f7db5c0aa8 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Wed, 10 Apr 2013 13:45:29 +0200 Subject: [PATCH] media-export: Prevent critical With the previous change, if a file was added to the toplevel container, a critical would occur since its parent is not a DummyContainer and thus the cast resulted in NULL. --- src/plugins/media-export/rygel-media-export-harvesting-task.vala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/media-export/rygel-media-export-harvesting-task.vala b/src/plugins/media-export/rygel-media-export-harvesting-task.vala index d693f6d..8cbec76 100644 --- a/src/plugins/media-export/rygel-media-export-harvesting-task.vala +++ b/src/plugins/media-export/rygel-media-export-harvesting-task.vala @@ -184,9 +184,9 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine, // Only add new containers. There's not much about a container so // we skip the updated signal var dummy_parent = parent as DummyContainer; - if (dummy_parent != null && - dummy_parent.children.contains (MediaCache.get_id (file))) { - dummy_parent.add_child_tracked.begin (container); + if (dummy_parent == null || + !dummy_parent.children.contains (MediaCache.get_id (file))) { + (parent as TrackableContainer).add_child_tracked.begin (container); } return true; -- 2.7.4