[rygel] core: Don't crash if log_domain is unset



commit ed052837f869837f823c9ee127fce769dbe6a8e5
Author: Jens Georg <mail jensge org>
Date:   Tue Mar 1 14:24:14 2011 +0200

    core: Don't crash if log_domain is unset

 src/rygel/rygel-log-handler.vala |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-log-handler.vala b/src/rygel/rygel-log-handler.vala
index 33e6324..b4ccd4a 100644
--- a/src/rygel/rygel-log-handler.vala
+++ b/src/rygel/rygel-log-handler.vala
@@ -97,7 +97,12 @@ public class Rygel.LogHandler : GLib.Object {
     private void log_func (string?       log_domain,
                            LogLevelFlags log_levels,
                            string        message) {
-        var flags = this.log_level_hash[log_domain];
+        LogLevelFlags flags = 0;
+
+        if (log_domain != null) {
+            flags = this.log_level_hash[log_domain];
+        }
+
         if (flags == 0) {
             flags = this.log_level_hash["*"];
         }



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