diff options
author | Nick Schermer <nick@xfce.org> | 2013-05-04 16:53:26 +0200 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2013-05-04 16:53:26 +0200 |
commit | a9c038264712a58b38981bdb0aa2d0a672017b18 (patch) | |
tree | d2bd1074ca42fd7358974f0099ae3dc2f741bef5 | |
parent | bd98846ce8b5b318004a8cac4fbcff23efb59865 (diff) | |
download | tumbler-a9c038264712a58b38981bdb0aa2d0a672017b18.tar.gz |
Add some additional debug checks.
-rw-r--r-- | tumbler/tumbler-thumbnailer.c | 3 | ||||
-rw-r--r-- | tumblerd/tumbler-registry.c | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/tumbler/tumbler-thumbnailer.c b/tumbler/tumbler-thumbnailer.c index 14e2b71..213c8c5 100644 --- a/tumbler/tumbler-thumbnailer.c +++ b/tumbler/tumbler-thumbnailer.c @@ -245,6 +245,9 @@ tumbler_thumbnailer_supports_location (TumblerThumbnailer *thumbnailer, GSList *locations, *lp; gboolean supported = FALSE; + g_return_val_if_fail (TUMBLER_IS_THUMBNAILER (thumbnailer), FALSE); + g_return_val_if_fail (G_IS_FILE (file), FALSE); + /* we're cool if no locations are set */ g_object_get (thumbnailer, "locations", &locations, NULL); if (locations == NULL) diff --git a/tumblerd/tumbler-registry.c b/tumblerd/tumbler-registry.c index 61739ac..1a2e02b 100644 --- a/tumblerd/tumbler-registry.c +++ b/tumblerd/tumbler-registry.c @@ -274,13 +274,19 @@ tumbler_registry_lookup (TumblerRegistry *registry, thumbnailer = g_hash_table_lookup (registry->preferred_thumbnailers, hash_key); if (thumbnailer != NULL) - available = g_list_prepend (available, g_object_ref (thumbnailer)); + { + g_return_val_if_fail (TUMBLER_IS_THUMBNAILER (available), NULL); + available = g_list_prepend (available, g_object_ref (thumbnailer)); + } list = g_hash_table_lookup (registry->thumbnailers, hash_key); if (list != NULL) { for (lp = *list; lp != NULL; lp = lp->next) - available = g_list_prepend (available, g_object_ref (lp->data)); + { + g_return_val_if_fail (TUMBLER_IS_THUMBNAILER (lp->data), NULL); + available = g_list_prepend (available, g_object_ref (lp->data)); + } } return g_list_reverse (available); @@ -294,6 +300,8 @@ tumbler_registry_get_file_size (GFile *gfile) GFileInfo *file_info; gint64 size = 0; + g_return_val_if_fail (G_IS_FILE (gfile), 0); + file_info = g_file_query_info (gfile, G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NONE, NULL, NULL); |