[tracker/rss-enclosures] libtracker-data: Guard against null for domain specific index support



commit 539f7a1ed4360241a519cfcbd35a29fc8af2ce5e
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Jul 6 12:16:34 2010 +0200

    libtracker-data: Guard against null for domain specific index support

 src/libtracker-data/tracker-sparql-pattern.vala |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-pattern.vala b/src/libtracker-data/tracker-sparql-pattern.vala
index 06cff67..fa4b1f1 100644
--- a/src/libtracker-data/tracker-sparql-pattern.vala
+++ b/src/libtracker-data/tracker-sparql-pattern.vala
@@ -1223,10 +1223,17 @@ class Tracker.Sparql.Pattern : Object {
 					Variable v = context.get_variable (current_subject);
 					VariableBindingList list = triple_context.var_bindings.lookup (v);
 
-					foreach (Class cl in prop.get_domain_indexes ()) {
-						foreach (VariableBinding b in list.list) {
-							if (b.type == cl) {
-								db_table = cl.name;
+					if (list != null && list.list != null) {
+						bool stop = false;
+						foreach (Class cl in prop.get_domain_indexes ()) {
+							foreach (VariableBinding b in list.list) {
+								if (b.type == cl) {
+									db_table = cl.name;
+									stop = true;
+									break;
+								}
+							}
+							if (stop) {
 								break;
 							}
 						}



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