display: Early return in monitor_labeler_show() if no outputs are available
The GVariant constructed here would be useless otherwise, since there are no outputs to show the labels for. Besides, calling g_variant_builder_close in this scenario would hit an assertion and the program would crash. https://gitlab.gnome.org/GNOME/gnome-control-center/issues/12
This commit is contained in:
parent
729db87249
commit
ca9228bb59
1 changed files with 4 additions and 1 deletions
|
@ -207,13 +207,16 @@ monitor_labeler_show (CcDisplayPanel *self)
|
|||
if (!priv->shell_proxy || !priv->current_config)
|
||||
return;
|
||||
|
||||
outputs = g_object_get_data (G_OBJECT (priv->current_config), "ui-sorted-outputs");
|
||||
if (!outputs)
|
||||
return;
|
||||
|
||||
if (cc_display_config_is_cloning (priv->current_config))
|
||||
return monitor_labeler_hide (self);
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
|
||||
g_variant_builder_open (&builder, G_VARIANT_TYPE_ARRAY);
|
||||
|
||||
outputs = g_object_get_data (G_OBJECT (priv->current_config), "ui-sorted-outputs");
|
||||
for (l = outputs; l != NULL; l = l->next)
|
||||
{
|
||||
CcDisplayMonitor *output = l->data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue