oci-authenticator: fix failures to clear GError

Fix problems overwriting a GError when we retry multiple times.
One of these was introduced with the recent change
e3f17a89a flatpak-oci-authenticator: try getting a token without credentials
but the other was existing.

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
(cherry picked from commit 425f628263)
This commit is contained in:
Owen W. Taylor
2020-03-16 15:58:16 -04:00
committed by Alexander Larsson
parent f4f387a509
commit 53142f3d6a

View File

@@ -496,6 +496,8 @@ handle_request_ref_tokens (FlatpakAuthenticator *authenticator,
first_token = get_token_for_ref (registry, ref_data, NULL, &error);
if (first_token != NULL)
have_auth = TRUE;
else
g_clear_error (&error);
}
/* Prompt the user for credentials */
@@ -520,6 +522,11 @@ handle_request_ref_tokens (FlatpakAuthenticator *authenticator,
auth = g_steal_pointer (&test_auth);
have_auth = TRUE;
}
else
{
g_debug ("Failed to get token: %s", error->message);
g_clear_error (&error);
}
}
}