[gnome-online-accounts/wip/rishi/gtask2: 13/13] httpclient: Be more strict about what is acceptable



commit 63f19700703f9d70956befdd46124ae8aa3d145b
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Jan 9 17:51:09 2017 +0100

    httpclient: Be more strict about what is acceptable

 src/goabackend/goahttpclient.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/goabackend/goahttpclient.c b/src/goabackend/goahttpclient.c
index e2a1f59..e5a01de 100644
--- a/src/goabackend/goahttpclient.c
+++ b/src/goabackend/goahttpclient.c
@@ -299,6 +299,7 @@ goa_http_client_check_finish (GoaHttpClient *self, GAsyncResult *res, GError **e
 {
   GTask *task;
 
+  g_return_val_if_fail (GOA_IS_HTTP_CLIENT (self), FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
   g_return_val_if_fail (g_task_is_valid (res, self), FALSE);
@@ -339,6 +340,13 @@ goa_http_client_check_sync (GoaHttpClient       *self,
   CheckSyncData data;
   GMainContext *context = NULL;
 
+  g_return_val_if_fail (GOA_IS_HTTP_CLIENT (self), FALSE);
+  g_return_val_if_fail (uri != NULL && uri[0] != '\0', FALSE);
+  g_return_val_if_fail (username != NULL && username[0] != '\0', FALSE);
+  g_return_val_if_fail (password != NULL && password[0] != '\0', FALSE);
+  g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
   data.error = error;
 
   context = g_main_context_new ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]