aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-10-19 23:55:55 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-10-23 08:51:19 +0800
commit671ba19294ca66e5ebedf87eee6c3d486bb244a8 (patch)
tree1cc23ff96fe07c1223ba8279f45572b85f84640a /e-util
parent85ba04c9f08164ec0fcf7d2272fcd854178bbbf0 (diff)
downloadgsoc2013-evolution-671ba19294ca66e5ebedf87eee6c3d486bb244a8.tar
gsoc2013-evolution-671ba19294ca66e5ebedf87eee6c3d486bb244a8.tar.gz
gsoc2013-evolution-671ba19294ca66e5ebedf87eee6c3d486bb244a8.tar.bz2
gsoc2013-evolution-671ba19294ca66e5ebedf87eee6c3d486bb244a8.tar.lz
gsoc2013-evolution-671ba19294ca66e5ebedf87eee6c3d486bb244a8.tar.xz
gsoc2013-evolution-671ba19294ca66e5ebedf87eee6c3d486bb244a8.tar.zst
gsoc2013-evolution-671ba19294ca66e5ebedf87eee6c3d486bb244a8.zip
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.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-source-selector.c4
1 files changed, 3 insertions, 1 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);
+ }
+ if (selected != NULL) {
e_source_selector_set_primary_selection (selector, selected);
+ g_object_unref (selected);
}
- g_object_unref (selected);
}
static void