From 671ba19294ca66e5ebedf87eee6c3d486bb244a8 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 19 Oct 2013 11:55:55 -0400 Subject: [PATCH] ESourceSelector: Fix a potential runtime warning. When (re)building the tree model, ESourceSelector may fall back to e_source_registry_ref_default_for_extension_name() to help initialize the primary selection. Depending on the selector's "extension-name" property, that function may return NULL. Handle it gracefully. --- e-util/e-source-selector.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/e-util/e-source-selector.c b/e-util/e-source-selector.c index e84566d887..b4f82c2c5b 100644 --- a/e-util/e-source-selector.c +++ b/e-util/e-source-selector.c @@ -366,9 +366,11 @@ source_selector_build_model (ESourceSelector *selector) if (selected == NULL) { selected = e_source_registry_ref_default_for_extension_name ( registry, extension_name); - e_source_selector_set_primary_selection (selector, selected); } - g_object_unref (selected); + if (selected != NULL) { + e_source_selector_set_primary_selection (selector, selected); + g_object_unref (selected); + } } static void