[rygel] core: Check for null before converting to upper case



commit 23f11390c9c919319c995a1af8066dfd16da4d86
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Apr 12 19:26:37 2011 +0300

    core: Check for null before converting to upper case

 src/rygel/rygel-relational-expression.vala |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/rygel/rygel-relational-expression.vala b/src/rygel/rygel-relational-expression.vala
index 5422e07..70f62d4 100644
--- a/src/rygel/rygel-relational-expression.vala
+++ b/src/rygel/rygel-relational-expression.vala
@@ -97,14 +97,19 @@ public class Rygel.RelationalExpression :
 
     public bool compare_string (string? str) {
         var up_operand2 = this.operand2.up ();
-        var up_str = str.up ();
+        string up_str;
+        if (str != null) {
+            up_str = str.up ();
+        } else {
+            up_str = null;
+        }
 
         switch (this.op) {
         case SearchCriteriaOp.EXISTS:
             if (this.operand2 == "true") {
-                return str != null;
+                return up_str != null;
             } else {
-                return str == null;
+                return up_str == null;
             }
         case SearchCriteriaOp.EQ:
             return up_operand2 == up_str;



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