summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2019-06-10 15:33:34 -0500
committerMichael Catanzaro <mcatanzaro@igalia.com>2019-06-10 15:33:34 -0500
commit7b76a6a3826cfebf8e67a15f801f4cd3548436be (patch)
tree1e92c1b5b2e8ec366156938769f41277a98e3e83
parente2966394b60adaa4ca4215ccdc4f5134c8951586 (diff)
downloadepiphany-7b76a6a3826cfebf8e67a15f801f4cd3548436be.tar.gz
embed-shell: don't query username_field without username
Because we don't save username_field in the password manager if username is not provided, we won't ever be able to successfully look up passwords in this case unless we clear it here, too.
-rw-r--r--embed/ephy-embed-shell.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 45cc66600..d7d2bbf03 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -425,6 +425,13 @@ web_process_extension_password_manager_query_received_cb (WebKitUserContentManag
if (!origin || !target_origin || !password_field)
return;
+ /* Don't include username_field in queries unless we actually have a username
+ * to go along with it, or the query will fail because we don't save
+ * username_field without a corresponding username.
+ */
+ if (!username && username_field)
+ g_clear_pointer (&username_field, g_free);
+
PasswordManagerData *data = g_new (PasswordManagerData, 1);
data->shell = g_object_ref (shell);
data->promise_id = promise_id;