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.
This commit is contained in:
Matthew Barnes
2013-10-19 11:55:55 -04:00
parent 85ba04c9f0
commit 671ba19294

View File

@ -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