[rygel] media-export: Add null checks to standard XDG folders
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Add null checks to standard XDG folders
- Date: Wed, 15 Sep 2010 17:04:28 +0000 (UTC)
commit 42a0f7b0809213da39ab1f7334c8b4596be12858
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Sep 15 20:02:28 2010 +0300
media-export: Add null checks to standard XDG folders
.../rygel-media-export-root-container.vala | 12 +++++++++---
1 files changed, 9 insertions(+), 3 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 6e573c9..0ccfe1b 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -196,9 +196,15 @@ public class Rygel.MediaExport.RootContainer : Rygel.MediaExport.DBContainer {
var music_dir = Environment.get_user_special_dir
(UserDirectory.MUSIC);
- actual_uri = actual_uri.replace ("@PICTURES@", pictures_dir);
- actual_uri = actual_uri.replace ("@VIDEOS@", videos_dir);
- actual_uri = actual_uri.replace ("@MUSIC@", music_dir);
+ if (likely (pictures_dir != null)) {
+ actual_uri = actual_uri.replace ("@PICTURES@", pictures_dir);
+ }
+ if (likely (videos_dir != null)) {
+ actual_uri = actual_uri.replace ("@VIDEOS@", videos_dir);
+ }
+ if (likely (music_dir != null)) {
+ actual_uri = actual_uri.replace ("@MUSIC@", music_dir);
+ }
actual_uris.add (actual_uri);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]