[evolution] ESourceComboBox: Check ESource's BackendName is filled before using it



commit 7ae0a37c2e3dc27e9fb5d5aaa9ef59a537c7b075
Author: Milan Crha <mcrha redhat com>
Date:   Wed Mar 24 10:16:37 2021 +0100

    ESourceComboBox: Check ESource's BackendName is filled before using it
    
    This avoids a crash for broken sources.
    
    Reported downstream at:
    https://bugzilla.redhat.com/show_bug.cgi?id=1942071

 src/e-util/e-source-combo-box.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/e-util/e-source-combo-box.c b/src/e-util/e-source-combo-box.c
index 443092c9c8..fa164c57c1 100644
--- a/src/e-util/e-source-combo-box.c
+++ b/src/e-util/e-source-combo-box.c
@@ -85,9 +85,13 @@ source_combo_box_traverse (GNode *node,
                extension = e_source_get_extension (source, ext_name);
                sensitive = TRUE;
 
-               if (g_hash_table_size (combo_box->priv->hide_sources) && E_IS_SOURCE_BACKEND (extension) &&
-                   g_hash_table_contains (combo_box->priv->hide_sources, e_source_backend_get_backend_name 
(E_SOURCE_BACKEND (extension)))) {
-                       return FALSE;
+               if (g_hash_table_size (combo_box->priv->hide_sources) && E_IS_SOURCE_BACKEND (extension)) {
+                       ESourceBackend *backend = E_SOURCE_BACKEND (extension);
+
+                       if (e_source_backend_get_backend_name (backend) &&
+                           g_hash_table_contains (combo_box->priv->hide_sources, 
e_source_backend_get_backend_name (backend))) {
+                               return FALSE;
+                       }
                }
        }
 


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