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
This commit is contained in:
Jeremias Ortega 2021-01-30 18:38:43 -06:00
parent e99115e99f
commit c524e17798
No known key found for this signature in database
GPG key ID: 352A7AAD8F058B66

View file

@ -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