From 95d6730b1b73f81822edaa28d041dc9253abe459 Mon Sep 17 00:00:00 2001 From: Jiaqiang Xu Date: Thu, 12 Nov 2015 10:40:40 +0800 Subject: [PATCH] Allow creator_name in commit object to be NULL for compatibility. --- common/commit-mgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/commit-mgr.c b/common/commit-mgr.c index 6a1cbd698..a4cf1ed7e 100644 --- a/common/commit-mgr.c +++ b/common/commit-mgr.c @@ -717,7 +717,6 @@ commit_from_json_object (const char *commit_id, json_t *object) if (!repo_id || !is_uuid_valid(repo_id) || !root_id || !is_object_id_valid(root_id) || !creator || strlen(creator) != 40 || - !creator_name || (parent_id && !is_object_id_valid(parent_id)) || (second_parent_id && !is_object_id_valid(second_parent_id))) return commit; @@ -740,7 +739,7 @@ commit_from_json_object (const char *commit_id, json_t *object) return NULL; } - char *creator_name_l = g_ascii_strdown (creator_name, -1); + char *creator_name_l = creator_name ? g_ascii_strdown (creator_name, -1) : NULL; commit = seaf_commit_new (commit_id, repo_id, root_id, creator_name_l, creator, desc, ctime); g_free (creator_name_l);