[tracker/tracker-0.10] libtracker-bus: Let get_string return null for unbound values



commit 1b6fb52578a2dddf84fd1b862d560ebaea9ec167
Author: Jürg Billeter <j bitron ch>
Date:   Fri Mar 11 10:20:23 2011 +0100

    libtracker-bus: Let get_string return null for unbound values
    
    Fixes GB#642868.

 src/libtracker-bus/tracker-bus-fd-cursor.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus-fd-cursor.vala b/src/libtracker-bus/tracker-bus-fd-cursor.vala
index 7294aa3..d7c055e 100644
--- a/src/libtracker-bus/tracker-bus-fd-cursor.vala
+++ b/src/libtracker-bus/tracker-bus-fd-cursor.vala
@@ -66,6 +66,12 @@ class Tracker.Bus.FDCursor : Tracker.Sparql.Cursor {
 	requires (column < n_columns && data != null) {
 		unowned string str = null;
 
+		// return null instead of empty string for unbound values
+		if (types[column] == Sparql.ValueType.UNBOUND) {
+			length = 0;
+			return null;
+		}
+
 		if (column == 0) {
 			str = (string) data;
 		} else {



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