summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-06-13 11:37:19 +0200
committerDavid King <amigadave@amigadave.com>2013-06-16 21:56:26 +0100
commit0cfc97bfa3ec22349540d6de09a9485d274b504a (patch)
tree72de13fd3cc8b7c18c3ad75317b8ccaa06d41ca0
parent6c5c7ebaf58387fb93bfe136cfc654cf986ff157 (diff)
downloadcheese-0cfc97bfa3ec22349540d6de09a9485d274b504a.tar.gz
Fix assertion failures when taking a photo
Before this patch, Cheese would log the following each time the user takes a photo: (cheese:21719): GLib-GIO-CRITICAL **: g_file_info_get_size: assertion `G_IS_FILE_INFO (info)' failed (cheese:21719): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--src/thumbview/cheese-thumb-view.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/thumbview/cheese-thumb-view.c b/src/thumbview/cheese-thumb-view.c
index c229b1a4..a702fc0b 100644
--- a/src/thumbview/cheese-thumb-view.c
+++ b/src/thumbview/cheese-thumb-view.c
@@ -205,6 +205,13 @@ cheese_thumb_view_append_item (CheeseThumbView *thumb_view, GFile *file)
info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_SIZE, 0, NULL,
NULL);
+ if (!info)
+ {
+ /* This is normal since photos first get created with a tmpname, ie:
+ * "2013-06-13-113155.jpg.DQRGYW" and then moved to their final name,
+ * we will get another append_item call for the final name. */
+ return;
+ }
size = g_file_info_get_size (info);
g_object_unref (info);