[network-manager-applet] libnma/cert-chooser: handle case of no avalable modules



commit a37483c1a364ef3cc1cfa29e7ad51ca108d75674
Author: Ben Wiederhake <BenWiederhake GitHub gmx de>
Date:   Sun Jan 14 23:28:15 2018 +0100

    libnma/cert-chooser: handle case of no avalable modules
    
    Cause: Apparently it's perfectly okay if the list of modules is empty
    (e.g., NULL).  However, the code assume that this indicates an error,
    tries to print the NULL error, and crashes.
    
    [lkundrak v3 sk: cosmetic changes]
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785674

 src/libnma/nma-cert-chooser-button.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libnma/nma-cert-chooser-button.c b/src/libnma/nma-cert-chooser-button.c
index c708939..0065176 100644
--- a/src/libnma/nma-cert-chooser-button.c
+++ b/src/libnma/nma-cert-chooser-button.c
@@ -93,10 +93,10 @@ modules_initialized (GObject *object, GAsyncResult *res, gpointer user_data)
        gchar *label;
 
        modules = gck_modules_initialize_registered_finish (res, &error);
-       if (!modules) {
+       if (error) {
                /* The Front Fell Off. */
-               g_critical ("Error getting registered modules: %s", error->message);
-               g_error_free (error);
+               g_warning ("Error getting registered modules: %s", error->message);
+               g_clear_error (&error);
        }
 
        model = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (self)));


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