[tracker] TST: segfault fix



commit 44c0ceb091cc6ec0ab6717255a6fb0729e9ebd91
Author: Tshepang Lekhonkhobe <tshepang gmail com>
Date:   Wed May 5 02:46:57 2010 +0200

    TST: segfault fix

 src/tracker-search-tool/tracker-metadata-tile.gs |    8 ++++++--
 src/tracker-search-tool/tracker-query.gs         |    1 -
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-search-tool/tracker-metadata-tile.gs b/src/tracker-search-tool/tracker-metadata-tile.gs
index 620b532..fdae19f 100644
--- a/src/tracker-search-tool/tracker-metadata-tile.gs
+++ b/src/tracker-search-tool/tracker-metadata-tile.gs
@@ -253,8 +253,12 @@ class TrackerMetadataTile : EventBox
         var query = "SELECT rdf:type(?s) where { ?s nie:url \"%s\" }".printf(uri)
         var results = Query.Query (query)
         var res = ""
-        for s in results
-            res += s
+
+        if results is null
+            print "Query result is null!"
+        
+        else
+            res = results[0]
 
         if res.contains ("nfo#Video") do return Categories.Video
         if res.contains ("nfo#Image") do return Categories.Image
diff --git a/src/tracker-search-tool/tracker-query.gs b/src/tracker-search-tool/tracker-query.gs
index 50363bf..1c60d0c 100644
--- a/src/tracker-search-tool/tracker-query.gs
+++ b/src/tracker-search-tool/tracker-query.gs
@@ -92,7 +92,6 @@ class TrackerQuery : Object
         return null
 
 
-
     def Query (sparql : string) : array of string[,]?
         try
             return tracker.SparqlQuery (sparql)



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