[tracker/tracker-0.14] libtracker-miner: Don't abort() if none file:// URI themes are used



commit c3306801aef196c79a8cc6f3c2c32716b84d29d0
Author: Martyn Russell <martyn lanedo com>
Date:   Mon Apr 30 11:52:11 2012 +0100

    libtracker-miner: Don't abort() if none file:// URI themes are used
    
    Was occuring with sftp:// mounts pulled in from GVFS.

 src/libtracker-miner/tracker-file-notifier.c |    3 +++
 src/libtracker-miner/tracker-file-system.c   |   11 ++++++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 22d9ae1..5d416a6 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -1377,6 +1377,9 @@ tracker_file_notifier_get_file_iri (TrackerFileNotifier *notifier,
 	                                          file,
 	                                          G_FILE_TYPE_REGULAR,
 	                                          NULL);
+	if (!canonical) {
+		return NULL;
+	}
 
 	iri = tracker_file_system_get_property (priv->file_system,
 	                                        canonical,
diff --git a/src/libtracker-miner/tracker-file-system.c b/src/libtracker-miner/tracker-file-system.c
index 609734e..269df32 100644
--- a/src/libtracker-miner/tracker-file-system.c
+++ b/src/libtracker-miner/tracker-file-system.c
@@ -481,7 +481,16 @@ tracker_file_system_get_file (TrackerFileSystem *file_system,
 	}
 
 	if (!node) {
-		g_assert (parent_node != NULL);
+		if (!parent_node) {
+			gchar *uri;
+
+			uri = g_file_get_uri (file);
+			g_warning ("Could not find parent node for URI:'%s'", uri);
+			g_warning ("NOTE: URI themes other than 'file://' are not supported currently.");
+			g_free (uri);
+
+			return NULL;
+		}
 
 		node = g_node_new (NULL);
 



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