[tracker/wip/sam/resource-rebase-1] squash! Use TrackerResource instead of TrackerSparqlBuilder in all extractors
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/sam/resource-rebase-1] squash! Use TrackerResource instead of TrackerSparqlBuilder in all extractors
- Date: Thu, 30 Jun 2016 01:29:26 +0000 (UTC)
commit f4c2d30b354d6acbd47f68146be9d9dc23c011e1
Author: Sam Thursfield <sam afuera me uk>
Date: Wed Jun 29 22:28:32 2016 +0100
squash! Use TrackerResource instead of TrackerSparqlBuilder in all extractors
Don't crash when the extractor returns no resource.
There are situations where this can happen legitimately, such as the
GStreamer extractor looking at a file without the right plugin available
to parse it. So we log the situation but don't warn.
src/tracker-extract/tracker-extract-decorator.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-decorator.c b/src/tracker-extract/tracker-extract-decorator.c
index 43ac546..13f316b 100644
--- a/src/tracker-extract/tracker-extract-decorator.c
+++ b/src/tracker-extract/tracker-extract-decorator.c
@@ -151,6 +151,13 @@ decorator_save_info (TrackerSparqlBuilder *sparql,
TrackerNamespaceManager *namespaces = tracker_namespace_manager_get_default ();
resource = tracker_extract_info_get_resource (info);
+
+ if (resource == NULL) {
+ g_message ("Extract module returned no resource for %s",
+ tracker_decorator_info_get_url (info));
+ return;
+ }
+
urn = tracker_decorator_info_get_urn (decorator_info);
tracker_resource_set_identifier (resource, urn);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]