[rygel] media-export: fix crash if nothing was configured
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Subject: [rygel] media-export: fix crash if nothing was configured
- Date: Wed, 17 Jun 2009 08:45:39 -0400 (EDT)
commit 022e7662449d4fb81d96d59a3d7428b2811834c0
Author: Jens Georg <mail jensge org>
Date: Tue Jun 16 20:16:39 2009 +0200
media-export: fix crash if nothing was configured
.../rygel-media-export-root-container.vala | 9 ++++++++-
1 files changed, 8 insertions(+), 1 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 5ac3ad5..1f6ca2c 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -89,14 +89,21 @@ public class Rygel.MediaExportRootContainer : MediaContainer {
*/
public MediaExportRootContainer () {
base.root ("MediaExportRoot", 0);
+ ArrayList<string> uris;
this.children = new ArrayList<MediaExportContainer> ();
var config = Rygel.MetaConfig.get_default ();
- var uris = config.get_string_list ("MediaExport", "uris");
+
+ try {
+ uris = config.get_string_list ("MediaExport", "uris");
+ } catch (Error error) {
+ uris = new ArrayList<string> ();
+ }
// either an error occured or the gconf key is not set
if (uris.size == 0) {
+ debug("Nothing configured, using XDG special directories");
var uri = Environment.get_user_special_dir (UserDirectory.MUSIC);
if (uri != null)
uris.add (uri);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]