[gnome-software] trivial: Fix critical warning when getting the OS release



commit 2f9f190e33a811747be87d54bc939014347dc7a6
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jun 1 09:45:52 2016 +0100

    trivial: Fix critical warning when getting the OS release

 src/gs-sources-dialog.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-sources-dialog.c b/src/gs-sources-dialog.c
index a7b7826..9c6a188 100644
--- a/src/gs-sources-dialog.c
+++ b/src/gs-sources-dialog.c
@@ -396,8 +396,11 @@ static gchar *
 get_os_name (void)
 {
        gchar *name = NULL;
+       g_autoptr(GsOsRelease) os_release = NULL;
 
-       name = gs_os_release_get_name (NULL);
+       os_release = gs_os_release_new (NULL);
+       if (os_release != NULL)
+               name = g_strdup (gs_os_release_get_name (os_release));
        if (name == NULL) {
                /* TRANSLATORS: this is the fallback text we use if we can't
                   figure out the name of the operating system */


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