summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Sanchez Prada <mario@endlessm.com>2018-03-12 14:04:05 +0000
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2018-03-14 23:27:44 +0000
commitca9228bb59aa29d80cb2ff8f62b8690b78abb136 (patch)
tree34bedde7232c90642c67dadc0101db6e7ee16444
parent729db872491c6443651e784fb09dbdcf64d11f6c (diff)
downloadgnome-control-center-issue12.tar.gz
display: Early return in monitor_labeler_show() if no outputs are availableissue12
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
-rw-r--r--panels/display/cc-display-panel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 256fc8682..0b4fa193d 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -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;