[gnome-documents/gnome-3-2] documents: make sure to call get_name() only on non-null GAppInfos
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/gnome-3-2] documents: make sure to call get_name() only on non-null GAppInfos
- Date: Tue, 25 Oct 2011 19:54:16 +0000 (UTC)
commit 5a474e4be244e6446fa4546b747976ee0a93a925
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Oct 25 15:53:21 2011 -0400
documents: make sure to call get_name() only on non-null GAppInfos
Otherwise we will throw an exception when there's no default app for one
of the content types we use.
src/documents.js | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index 8b50425..449d6f0 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -251,8 +251,10 @@ LocalDocument.prototype = {
DocCommon.prototype._init.call(this, cursor);
this.sourceName = _("Local");
+
let defaultApp = Gio.app_info_get_default_for_type(this.mimeType, true);
- this.defaultAppName = defaultApp.get_name();
+ if (defaultApp)
+ this.defaultAppName = defaultApp.get_name();
},
updateTypeDescription: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]