diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-06-13 11:37:19 +0200 |
---|---|---|
committer | David King <amigadave@amigadave.com> | 2013-06-16 21:56:26 +0100 |
commit | 0cfc97bfa3ec22349540d6de09a9485d274b504a (patch) | |
tree | 72de13fd3cc8b7c18c3ad75317b8ccaa06d41ca0 | |
parent | 6c5c7ebaf58387fb93bfe136cfc654cf986ff157 (diff) | |
download | cheese-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.c | 7 |
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); |