[rygel/rygel-0-12] core: Prevent critical if URI exists
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel/rygel-0-12] core: Prevent critical if URI exists
- Date: Sat, 22 Oct 2011 05:36:53 +0000 (UTC)
commit 6f40861af977063e6a9490ed19586ecb5303db68
Author: Jens Georg <mail jensge org>
Date: Thu Oct 13 10:52:54 2011 +0200
core: Prevent critical if URI exists
If the where clause does not match, there is no hash-table returned,
not an empty one.
.../tracker/rygel-tracker-insertion-query.vala | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-insertion-query.vala b/src/plugins/tracker/rygel-tracker-insertion-query.vala
index 228feb2..29f8e56 100644
--- a/src/plugins/tracker/rygel-tracker-insertion-query.vala
+++ b/src/plugins/tracker/rygel-tracker-insertion-query.vala
@@ -109,15 +109,14 @@ public class Rygel.Tracker.InsertionQuery : Query {
var result = yield resources.sparql_update_blank (str);
- this.id = result[0,0].lookup (TEMP_ID);
-
// Item already existed
- if (this.id == null) {
+ if (result[0,0] == null || result[0,0].lookup (TEMP_ID) == null) {
var ids = yield resources.sparql_query
(this.get_resource_id_query ());
this.id = ids[0,0];
} else {
+ this.id = result[0,0].lookup (TEMP_ID);
var file = File.new_for_uri (this.uri);
if (file.is_native () &&
file.query_exists ()) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]