[tracker/tracker-0.8] TST: segfault fix
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.8] TST: segfault fix
- Date: Thu, 6 May 2010 17:57:50 +0000 (UTC)
commit 03d9c2581dc58d01824d900f28e17007fb37d153
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]