Null-checking the text_gateway makes no sense as it has already been
dereferenced earlier. Instead check if it's the empty string and
treat that as not-an-error. Also prevent the empty string from
being set in default_gateway.
https://bugzilla.gnome.org/show_bug.cgi?id=708500
Gbp-Pq: Name git_allow_empty_ip4_gateway.patch
}
if (gtk_widget_is_visible (GTK_WIDGET (gateway_entry)) &&
- text_gateway && !nm_utils_ipaddr_valid (AF_INET, text_gateway)) {
+ *text_gateway &&
+ !nm_utils_ipaddr_valid (AF_INET, text_gateway)) {
widget_set_error (g_object_get_data (G_OBJECT (row), "gateway"));
ret = FALSE;
} else {
widget_unset_error (GTK_WIDGET (gateway_entry));
- if (gtk_widget_is_visible (GTK_WIDGET (gateway_entry))) {
+ if (gtk_widget_is_visible (GTK_WIDGET (gateway_entry)) && *text_gateway) {
g_assert (default_gateway == NULL);
default_gateway = text_gateway;
}