[libgdata] tasks: Add preconditions for tasklist IDs being set when inserting tasks
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata] tasks: Add preconditions for tasklist IDs being set when inserting tasks
- Date: Sun, 21 Sep 2014 16:42:56 +0000 (UTC)
commit 730c2de9ba7d9cdd1903ffe3387e9bfe6508a53b
Author: Philip Withnall <philip tecnocode co uk>
Date: Sun Sep 21 17:30:36 2014 +0100
tasks: Add preconditions for tasklist IDs being set when inserting tasks
Can’t insert a task to a non-tasklist.
gdata/services/tasks/gdata-tasks-service.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gdata/services/tasks/gdata-tasks-service.c b/gdata/services/tasks/gdata-tasks-service.c
index 7be4090..2c68ca6 100644
--- a/gdata/services/tasks/gdata-tasks-service.c
+++ b/gdata/services/tasks/gdata-tasks-service.c
@@ -418,6 +418,7 @@ gdata_tasks_service_query_tasks (GDataTasksService *self, GDataTasksTasklist *ta
g_return_val_if_fail (GDATA_IS_TASKS_SERVICE (self), NULL);
g_return_val_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist), NULL);
+ g_return_val_if_fail (gdata_entry_get_id (GDATA_ENTRY (tasklist)) != NULL, NULL);
g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
@@ -473,6 +474,7 @@ gdata_tasks_service_query_tasks_async (GDataTasksService *self, GDataTasksTaskli
g_return_if_fail (GDATA_IS_TASKS_SERVICE (self));
g_return_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist));
+ g_return_if_fail (gdata_entry_get_id (GDATA_ENTRY (tasklist)) != NULL);
g_return_if_fail (query == NULL || GDATA_IS_QUERY (query));
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
g_return_if_fail (callback != NULL);
@@ -522,6 +524,7 @@ gdata_tasks_service_insert_task (GDataTasksService *self, GDataTasksTask *task,
g_return_val_if_fail (GDATA_IS_TASKS_SERVICE (self), NULL);
g_return_val_if_fail (GDATA_IS_TASKS_TASK (task), NULL);
g_return_val_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist), NULL);
+ g_return_val_if_fail (gdata_entry_get_id (GDATA_ENTRY (tasklist)) != NULL, NULL);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
@@ -561,6 +564,7 @@ gdata_tasks_service_insert_task_async (GDataTasksService *self, GDataTasksTask *
g_return_if_fail (GDATA_IS_TASKS_SERVICE (self));
g_return_if_fail (GDATA_IS_TASKS_TASK (task));
g_return_if_fail (GDATA_IS_TASKS_TASKLIST (tasklist));
+ g_return_if_fail (gdata_entry_get_id (GDATA_ENTRY (tasklist)) != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.googleapis.com/tasks/v1/lists/",
gdata_entry_get_id (GDATA_ENTRY (tasklist)), "/tasks", NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]