[evolution-data-server] EGoaPasswordBased - Avoid runtime warning when checking OAuth2 based accounts



commit fc3d28f08f26bddfbc31a86b122612f0a87c7ac3
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]