[evolution-data-server/gnome-3-16] EGoaPasswordBased - Avoid runtime warning when checking OAuth2 based accounts
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-16] EGoaPasswordBased - Avoid runtime warning when checking OAuth2 based accounts
- Date: Mon, 23 Mar 2015 16:56:30 +0000 (UTC)
commit 8cc12c82de5dc479381268088e33eebbb9fe16f4
Author: Milan Crha <mcrha redhat com>
Date: Mon Mar 23 13:59:12 2015 +0100
EGoaPasswordBased - Avoid runtime warning when checking OAuth2 based accounts
.../gnome-online-accounts/e-goa-password-based.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/modules/gnome-online-accounts/e-goa-password-based.c
b/modules/gnome-online-accounts/e-goa-password-based.c
index 827c767..677cecb 100644
--- a/modules/gnome-online-accounts/e-goa-password-based.c
+++ b/modules/gnome-online-accounts/e-goa-password-based.c
@@ -217,8 +217,12 @@ e_goa_password_based_lookup_sync (ESourceCredentialsProviderImpl *provider_impl,
goa_account = goa_object_get_account (goa_object);
goa_password_based = goa_object_get_password_based (goa_object);
- /* XXX We should only be here if the account is password based. */
- g_return_val_if_fail (goa_password_based != NULL, FALSE);
+ if (!goa_password_based) {
+ /* Can be OAuth/2 based, thus return empty credentials. */
+ *out_credentials = e_named_parameters_new ();
+ success = TRUE;
+ goto exit;
+ }
success = goa_account_call_ensure_credentials_sync (
goa_account, NULL, cancellable, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]