[rygel] media-export: Prevent critical



commit de9f07ca0a2173a33b2abca77d5241f7db5c0aa8
Author: Jens Georg <jensg openismus com>
Date:   Wed Apr 10 13:45:29 2013 +0200

    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.

 .../rygel-media-export-harvesting-task.vala        |    6 +++---
 1 files 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;


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