[rygel] core: do not crash if plugins folder is missing



commit 8df903bd714649ce9fd640c2f3ef75447a65d988
Author: Manuel Bachmann <manuel bachmann iot bzh>
Date:   Wed Nov 4 09:59:03 2015 +0100

    core: do not crash if plugins folder is missing
    
    Issue a warning and return gracefully instead of crashing
    if the "lib/rygel-VERSION/plugins" folder is not found.
    
    The main thread will then detect that no plugins have been
    loaded, and exit with the appropriate message.
    
    Signed-off-by: Manuel Bachmann <manuel bachmann iot bzh>
    Author: Manuel Bachmann <manuel bachmann iot bzh>
    Author: Leon Anavi <leon anavi konsulko com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757570

 .../rygel-recursive-module-loader.vala             |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/librygel-core/rygel-recursive-module-loader.vala 
b/src/librygel-core/rygel-recursive-module-loader.vala
index da7b9f3..83d6fa0 100644
--- a/src/librygel-core/rygel-recursive-module-loader.vala
+++ b/src/librygel-core/rygel-recursive-module-loader.vala
@@ -66,7 +66,12 @@ public abstract class Rygel.RecursiveModuleLoader : Object {
         assert (Module.supported());
 
         var folder = File.new_for_path (this.base_path);
-        assert (folder != null && this.is_folder (folder));
+        if (folder == null || !this.is_folder (folder)) {
+            warning (_("Failed to open plugins folder: '%s'"),
+                     this.base_path);
+
+            return;
+        }
 
         this.load_modules_from_folder.begin (folder);
     }


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