[geary: 1/2] application-client: Check for null when getting os info




commit c524e177985e90342b13cac28abc7f454f710b2d
Author: Jeremias Ortega <jeremias ortega tech>
Date:   Sat Jan 30 18:38:43 2021 -0600

    application-client: Check for null when getting os info
    
    This caused a crash in the inspector system view when the os info wasn't
    available.
    
    Related to https://gitlab.gnome.org/GNOME/geary/-/issues/1123

 src/client/application/application-client.vala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/client/application/application-client.vala b/src/client/application/application-client.vala
index 0bd704fc7..19992eddf 100644
--- a/src/client/application/application-client.vala
+++ b/src/client/application/application-client.vala
@@ -304,12 +304,14 @@ public class Application.Client : Gtk.Application {
 
         /// Application runtime information label
         info.add({ _("Distribution name"),
-                    GLib.Environment.get_os_info(GLib.OsInfoKey.NAME)
+                    GLib.Environment.get_os_info(GLib.OsInfoKey.NAME) ??
+                    _("Unknown")
             });
 
         /// Application runtime information label
         info.add({_("Distribution release"),
-                GLib.Environment.get_os_info(GLib.OsInfoKey.VERSION)
+                GLib.Environment.get_os_info(GLib.OsInfoKey.VERSION) ??
+                _("Unknown")
             });
 
         /// Application runtime information label


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]