summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2016-02-14 19:45:02 +0100
committerJens Georg <mail@jensge.org>2016-02-14 19:47:37 +0100
commit545ccd6cabfbd8d2087af60b67a15c1b3216473f (patch)
tree9eda7d03d2f730ce41b84caa68295381040ecf70
parent50dade8f8af032427bee76abaf0038a0911dc31b (diff)
downloadrygel-545ccd6cabfbd8d2087af60b67a15c1b3216473f.tar.gz
media-export: Avoid crash on startup
There is a slight possibility that init() is not called on RootContainer before the first browse action starts. This will cause the ObjectFactory to return null as the Filesystem folder, causing a null pointer access. Signed-off-by: Jens Georg <mail@jensge.org>
-rw-r--r--src/plugins/media-export/rygel-media-export-root-container.vala7
1 files changed, 7 insertions, 0 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 9bfbd808..38b69801 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -350,6 +350,13 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
return true;
}
+ public override int count_children () {
+ if (!this.initialized) {
+ return 0;
+ } else {
+ return base.count_children ();
+ }
+ }
/**
* Create a new root container.