new-calendar-page: improve URI validity check

This check passes if the URI is empty. Normally this callback only runs
when there is text in the URL entry, but there is a race window where
the user could delete it first. (Passing NULL to a SoupURI creates an
invalid non-NULL empty URI that can be filled in later.)
This commit is contained in:
Michael Catanzaro
2020-04-02 03:09:06 +00:00
parent aaab4af282
commit bba6c60c32
@@ -341,7 +341,7 @@ validate_url_cb (gpointer data)
self->validate_url_resource_id = 0;
uri = soup_uri_new (gtk_entry_get_text (self->calendar_address_entry));
valid_uri = uri != NULL;
valid_uri = uri != NULL && SOUP_URI_IS_VALID (uri);
set_url_entry_error (self, !valid_uri);