[rygel] media-export: Fix crash if the virtual id is not known



commit 7e9be639d779e8fabe61f8085f61b5411fef30b0
Author: Jens Georg <mail jensge org>
Date:   Fri Mar 5 19:46:32 2010 +0100

    media-export: Fix crash if the virtual id is not known

 .../rygel-media-export-root-container.vala         |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index f67f27e..6047d09 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -153,13 +153,15 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
                 exp.operand2.has_prefix ("virtual-container:")) {
                 var real_id = MediaExportQueryContainer.get_virtual_container_definition
                 (exp.operand2);
-                var args = real_id.split(",");
-                query_cont = new MediaExportQueryContainer (this.media_db,
-                                                            exp.operand2,
-                                                            args[args.length-1]);
-                query_cont.parent = this;
                 list = new ArrayList<MediaObject> ();
-                list.add (query_cont);
+                if (real_id != null) {
+                    var args = real_id.split(",");
+                    query_cont = new MediaExportQueryContainer (this.media_db,
+                                                                exp.operand2,
+                                                                args[args.length-1]);
+                    query_cont.parent = this;
+                    list.add (query_cont);
+                }
                 total_matches = list.size;
                 return list;
             }



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