Commit 700152c7 authored by Giovanni Panozzo's avatar Giovanni Panozzo

Fix NULL pointer use, issue #546

parent 324c75e6
......@@ -750,7 +750,8 @@ static void remmina_protocol_widget_update_alignment(RemminaConnectionObject* cn
gtk_container_add(GTK_CONTAINER(cnnobj->aspectframe), cnnobj->proto);
g_object_unref(cnnobj->proto);
gtk_widget_show(cnnobj->aspectframe);
remmina_connection_holder_grab_focus(GTK_NOTEBOOK(cnnobj->cnnhld->cnnwin->priv->notebook));
if (cnnobj->cnnhld != NULL && cnnobj->cnnhld->cnnwin != NULL && cnnobj->cnnhld->cnnwin->priv->notebook != NULL)
remmina_connection_holder_grab_focus(GTK_NOTEBOOK(cnnobj->cnnhld->cnnwin->priv->notebook));
}
else
{
......@@ -768,7 +769,8 @@ static void remmina_protocol_widget_update_alignment(RemminaConnectionObject* cn
cnnobj->aspectframe = NULL;
gtk_container_add(GTK_CONTAINER(cnnobj->viewport), cnnobj->proto);
g_object_unref(cnnobj->proto);
remmina_connection_holder_grab_focus(GTK_NOTEBOOK(cnnobj->cnnhld->cnnwin->priv->notebook));
if (cnnobj->cnnhld != NULL && cnnobj->cnnhld->cnnwin != NULL && cnnobj->cnnhld->cnnwin->priv->notebook != NULL)
remmina_connection_holder_grab_focus(GTK_NOTEBOOK(cnnobj->cnnhld->cnnwin->priv->notebook));
}
}
......
......@@ -683,6 +683,11 @@ remmina_pref_keymap_groups(void)
gint remmina_pref_get_scale_quality(void)
{
TRACE_CALL("remmina_pref_get_scale_quality");
/* Paranoid programming */
if (remmina_pref.scale_quality < 0)
{
remmina_pref.scale_quality = 0;
}
return remmina_pref.scale_quality;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment