[gnome-contacts] Fix unhandled exception warning
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Fix unhandled exception warning
- Date: Tue, 6 Sep 2011 11:49:50 +0000 (UTC)
commit 3fe3f776ab08688881d54415a42e3cea3fff0fc8
Author: Alexander Larsson <alexl redhat com>
Date: Tue Sep 6 13:25:55 2011 +0200
Fix unhandled exception warning
src/contacts-contact-pane.vala | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index de632cc..a640fc7 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -922,13 +922,16 @@ public class Contacts.ContactPane : Grid {
var preview = chooser.get_preview_widget () as Image;
var file = File.new_for_uri (uri);
- var file_info = file.query_info (GLib.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
- FileQueryInfoFlags.NONE, null);
- if (file_info != null) {
- var mime_type = file_info.get_content_type ();
+ try {
+ var file_info = file.query_info (GLib.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+ FileQueryInfoFlags.NONE, null);
+ if (file_info != null) {
+ var mime_type = file_info.get_content_type ();
- if (mime_type != null)
- pixbuf = thumbnail_factory.generate_thumbnail (uri, mime_type);
+ if (mime_type != null)
+ pixbuf = thumbnail_factory.generate_thumbnail (uri, mime_type);
+ }
+ } catch (GLib.Error e) {
}
(chooser as Dialog).set_response_sensitive (ResponseType.ACCEPT,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]