[gnome-documents] documents: make sure to call get_name() only on non-null GAppInfos



commit 4661baea2e37c7e5adb96e5965b62a5315a54e1a
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 6eaa288..fe09b39 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -258,8 +258,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]